Fixed buffer overflow in JSON.
Reported on Coverity as CID 43614.
This commit is contained in:
parent
9ef4b9d52d
commit
b79142c8e7
@ -623,7 +623,7 @@ Reader::decodeDouble( Token &token )
|
|||||||
const int bufferSize = 32;
|
const int bufferSize = 32;
|
||||||
int count;
|
int count;
|
||||||
int length = int(token.end_ - token.start_);
|
int length = int(token.end_ - token.start_);
|
||||||
if ( length <= bufferSize )
|
if ( length < bufferSize )
|
||||||
{
|
{
|
||||||
Char buffer[bufferSize];
|
Char buffer[bufferSize];
|
||||||
memcpy( buffer, token.start_, length );
|
memcpy( buffer, token.start_, length );
|
||||||
|
Loading…
Reference in New Issue
Block a user