summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-08-18 13:39:20 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-08-18 13:39:20 +0200
commite5285319229a5d77bf316bb0d3a6cbd3cb8666d9 (patch)
treed5f5483066f463d903e1a79752c5eb0a91410891 /src
parent5597522cac96b1bc6d48a447751b1c6049248eef (diff)
pgxtoimage(): fix write stack buffer overflow (#997)
Diffstat (limited to 'src')
-rw-r--r--src/bin/jp2/convert.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/jp2/convert.c b/src/bin/jp2/convert.c
index 5459f7d4..e606c9be 100644
--- a/src/bin/jp2/convert.c
+++ b/src/bin/jp2/convert.c
@@ -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,