projects
/
openjpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb33299
)
JPWL: convert: Fix buffer overflow reading an image file less than four characters...
author
Robert Ancell
<robert.ancell@gmail.com>
Sun, 17 Nov 2019 02:09:59 +0000
(15:09 +1300)
committer
Even Rouault
<even.rouault@spatialys.com>
Sun, 17 Nov 2019 02:09:59 +0000
(
03:09
+0100)
Fixes #1068
src/bin/jpwl/convert.c
patch
|
blob
|
history
diff --git
a/src/bin/jpwl/convert.c
b/src/bin/jpwl/convert.c
index 4f636c175fce408fa30b85cd32181195734e6a1c..e6feea50124a7dc3f1cd848350729faa70a61ede 100644
(file)
--- a/
src/bin/jpwl/convert.c
+++ b/
src/bin/jpwl/convert.c
@@
-1488,7
+1488,7
@@
int imagetopgx(opj_image_t * image, const char *outfile)
const size_t olen = strlen(outfile);
const size_t dotpos = olen - 4;
const size_t total = dotpos + 1 + 1 + 4; /* '-' + '[1-3]' + '.pgx' */
- if (outfile[dotpos] != '.') {
+ if (o
len < 4 || o
utfile[dotpos] != '.') {
/* `pgx` was recognized but there is no dot at expected position */
fprintf(stderr, "ERROR -> Impossible happen.");
return 1;