Made two security fixes.

This commit is contained in:
Aaron Jacobs
2011-05-24 00:43:59 +00:00
parent 785ba2675d
commit a77a803c85
2 changed files with 11 additions and 0 deletions

View File

@@ -611,6 +611,11 @@ Reader::decodeDouble( Token &token )
int count;
int length = int(token.end_ - token.start_);
// Sanity check to avoid buffer overflow exploits.
if (length < 0) {
return addError( "Unable to parse token length", token );
}
// Avoid using a string constant for the format control string given to
// sscanf, as this can cause hard to debug crashes on OS X. See here for more
// info: