r=alecf. 39987. occasional crasher in nsMultiMixedConv.cpp stream converter. We now ensure that we don't search for EOL if we've moved beyond the legitimate buf len

This commit is contained in:
valeski%netscape.com 2000-05-22 06:06:57 +00:00
parent 3c17fb6537
commit 46aa24a067

View File

@ -440,7 +440,8 @@ nsMultiMixedConv::ParseHeaders(nsIChannel *aChannel, char *&aPtr,
PRBool done = PR_FALSE;
PRUint8 lineFeedIncrement = 1;
while ( (newLine = PL_strchr(cursor, LF)) ) {
while ( (cursorLen > 0)
&& (newLine = PL_strchr(cursor, LF)) ) {
// adjust for linefeeds
if ( (newLine > cursor) && (newLine[-1] == CR) ) { // CRLF
lineFeedIncrement = 2;