mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Bug 716556 - Fix possible buffer overflow with nsScriptableInputStream, r=bsmedberg
This commit is contained in:
parent
e6e23447b9
commit
7a8db952f3
@ -69,6 +69,9 @@ nsScriptableInputStream::Read(PRUint32 aCount, char **_retval) {
|
||||
|
||||
if (!mInputStream) return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
// bug716556 - Need room room for the null byte
|
||||
if (aCount > PR_UINT32_MAX - 1) return NS_ERROR_ILLEGAL_VALUE;
|
||||
|
||||
rv = mInputStream->Available(&count);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user