From fcd30e3c4e0dfda2722b1f37a445b9d78a0bf1a6 Mon Sep 17 00:00:00 2001 From: "harishd%netscape.com" Date: Sat, 31 Jul 1999 20:16:30 +0000 Subject: [PATCH] Fix for bug#s 10530, and 10596. Conditioning the raw buffer by removing the unwanted null chars. git-svn-id: svn://10.0.0.236/trunk@41738 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/src/nsParser.cpp | 9 +++++++++ mozilla/parser/htmlparser/src/nsParser.cpp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/mozilla/htmlparser/src/nsParser.cpp b/mozilla/htmlparser/src/nsParser.cpp index 0339282c0cf..bb5673a8a2c 100644 --- a/mozilla/htmlparser/src/nsParser.cpp +++ b/mozilla/htmlparser/src/nsParser.cpp @@ -1138,6 +1138,15 @@ nsresult nsParser::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUin if(mParserFilter) mParserFilter->RawBuffer(mParserContext->mTransferBuffer, &theNumRead); + // XXX Hack --- NULL character(s) is(are) seen in the middle of the buffer!!! + // For now, I'm conditioning the raw buffer by removing the unwanted null chars. + // Problem could be NECKO related + + for(PRUint32 i=0;imTransferBuffer[i]==kNullCh) + mParserContext->mTransferBuffer[i]=kSpace; + } + #ifdef NS_DEBUG int index=0; for(index=0;index<10;index++) diff --git a/mozilla/parser/htmlparser/src/nsParser.cpp b/mozilla/parser/htmlparser/src/nsParser.cpp index 0339282c0cf..bb5673a8a2c 100644 --- a/mozilla/parser/htmlparser/src/nsParser.cpp +++ b/mozilla/parser/htmlparser/src/nsParser.cpp @@ -1138,6 +1138,15 @@ nsresult nsParser::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUin if(mParserFilter) mParserFilter->RawBuffer(mParserContext->mTransferBuffer, &theNumRead); + // XXX Hack --- NULL character(s) is(are) seen in the middle of the buffer!!! + // For now, I'm conditioning the raw buffer by removing the unwanted null chars. + // Problem could be NECKO related + + for(PRUint32 i=0;imTransferBuffer[i]==kNullCh) + mParserContext->mTransferBuffer[i]=kSpace; + } + #ifdef NS_DEBUG int index=0; for(index=0;index<10;index++)