Skip to content

Commit

Permalink
pgxtoimage(): fix write stack buffer overflow (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Aug 18, 2017
1 parent 5597522 commit e528531
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bin/jp2/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ opj_image_t* pgxtoimage(const char *filename, opj_cparameters_t *parameters)
}

fseek(f, 0, SEEK_SET);
if (fscanf(f, "PG%[ \t]%c%c%[ \t+-]%d%[ \t]%d%[ \t]%d", temp, &endian1,
if (fscanf(f, "PG%31[ \t]%c%c%31[ \t+-]%d%31[ \t]%d%31[ \t]%d", temp, &endian1,
&endian2, signtmp, &prec, temp, &w, temp, &h) != 9) {
fclose(f);
fprintf(stderr,
Expand Down

0 comments on commit e528531

Please sign in to comment.