opj_mj2_extract: Check provided output prefix for length
authorKarol Babioch <kbabioch@suse.de>
Fri, 2 Mar 2018 13:40:58 +0000 (14:40 +0100)
committerEven Rouault <even.rouault@spatialys.com>
Sat, 22 Sep 2018 21:12:39 +0000 (23:12 +0200)
commitcc3824767bde397fedb8a1ae4786a222ba860c8d
tree3701a8a50716ec772f11ff19e52090a7e1fc74b2
parent564fbfb67830e2eb234bc16b3db8fecf54261f95
opj_mj2_extract: Check provided output prefix for length

This uses snprintf() with correct buffer length instead of sprintf(), which
prevents a buffer overflow when providing a long output prefix. Furthermore
the program exits with an error when the provided output prefix is too long.

Fixes #1088.
src/bin/mj2/opj_mj2_extract.c