Bug 716556 - Fix possible buffer overflow with nsScriptableInputStream, r=bsmedberg

This commit is contained in:
John Schoenick 2012-02-08 14:44:55 -08:00
parent e6e23447b9
commit 7a8db952f3

View File

@ -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;