cuesheet.c guard against invalid digits causing underflow on field ASAN

is digit checks for invalid fields but could possibly check field = -1

Change-Id: I5f6bc5047b1ec0bf122d360f8eb86e64a2784bef
This commit is contained in:
William Wilgus 2022-11-21 23:17:56 -05:00
parent 19aa4ca276
commit b40dff510a

View file

@ -139,7 +139,7 @@ static unsigned long parse_cue_index(const char *line)
while (isdigit(*line))
{
value = 10 * value + (*line - '0');
if (value > field_max[field]) /* Sanity check bail early */
if (field >= 0 && value > field_max[field]) /* Sanity check bail early */
return 0;
line++;
}