mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 451139 - "The return value of read() function should check in nsRandomAccessInputStream::readline instead of invoking failed()." [r=brendan sr=bsmedberg]
Index: xpcom/obsolete/nsFileStream.cpp =================================================================== RCS file: /cvsroot/mozilla/xpcom/obsolete/nsFileStream.cpp,v retrieving revision 1.5.28.1
This commit is contained in:
parent
54ca06a4e6
commit
00ce111e7d
@ -235,7 +235,7 @@ PRBool nsRandomAccessInputStream::readline(char* s, PRInt32 n)
|
||||
if (position < zero)
|
||||
return PR_FALSE;
|
||||
PRInt32 bytesRead = read(s, n - 1);
|
||||
if (failed())
|
||||
if (failed() || bytesRead < 0)
|
||||
return PR_FALSE;
|
||||
s[bytesRead] = '\0'; // always terminate at the end of the buffer
|
||||
char* tp = strpbrk(s, "\n\r");
|
||||
|
Loading…
Reference in New Issue
Block a user