Fix overflow in binutils fuzz target (#3363)

This commit is contained in:
Catena cyber 2020-02-09 16:33:56 +01:00 committed by GitHub
parent f585b66235
commit 3f808990af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ static int objdump_sprintf (void *vf, const char *format, ...)
va_end (args); va_end (args);
f->pos += n; f->pos += n;
//reset to keep just one line //reset to keep just one line
if (f->pos != 0 && f->buffer[f->pos - 1] == '\n') if (f->pos != 0 && f->buffer[f->pos - 1] == '\n' && f->pos <= MAX_TEXT_SIZE)
f->pos = 0; f->pos = 0;
return n; return n;
} }