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 9f48a1240f
commit 8ffc9cabe7

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;