Commit fa0cbd29 authored by Nicolas Trangez's avatar Nicolas Trangez Committed by Austin Seipp
Browse files

Fix potential out-of-bound memory access



Issue discovered by Coverity scan, CID 43165.
Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent f2595fd9
......@@ -332,7 +332,7 @@ GetHpTok(FILE *infp)
* "thefloatish").
*/
static char numberstring[ NUMBER_LENGTH - 1 ];
static char numberstring[ NUMBER_LENGTH + 1 ];
token
GetNumber(FILE *infp)
......@@ -350,7 +350,7 @@ GetNumber(FILE *infp)
ch = getc(infp);
}
ASSERT(i < NUMBER_LENGTH); /* did not overflow */
ASSERT(i <= NUMBER_LENGTH); /* did not overflow */
numberstring[ i ] = '\0';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment