Closed joshuay2022 closed 10 months ago
This is due to the lazy allocation of the subsampling array. While I fixed it, please use a better method for obtaining the subsampling in production code. First obtain the depth of the image with GetInformation(), then allocate the array, then get the subsampling information.
Hi, I found a bug related to stack buffer overflow in function 'Reconstruct' in source file 'cmd/reconstruct.cpp'.
Environment
Commit: latest 9e0cea2. OS and architecture: Ubuntu 22.04, x86_64 Compiler: Ubuntu clang version 14.0.0-1ubuntu1.1 Compiling:
CC="clang -fsanitize=address -O1 -fno-omit-frame-pointer -g"
,CXX="clang++ -fsanitize=address -O1 -fno-omit-frame-pointer -g"
Program command:./jpeg -oz -h -s 1x1,2x2,2x2 $poc /dev/null
PoC: poc.zipASan Output
The vulnerability may not be critical since the related code is in the 'cmd' directory.