packjpg / packJPG

A compression program for further compressing JPEG image files
http://packjpg.encode.ru/
GNU Lesser General Public License v3.0
165 stars 26 forks source link

AddressSanitizer report SEGV when use the packJPG #35

Open ConcoctionSec opened 3 years ago

ConcoctionSec commented 3 years ago

Version

packJPG v2.5k (01/22/2016)

Environment

Ubuntu 18.04,64 bit

Command

Compile test program:

$ make clean all

Compile test program with address sanitizer with this command:

CC = afl-gcc
CPP = afl-g++ 
LDFLAGS  =  -static-libgcc -static-libstdc++ -lstdc++fs
$ export AFL_USE_ASAN=1
$ make clean all

Result

The result of running without ASAN:

$ ./packJPG $poc

--> packJPG v2.5k (01/22/2016) by Matthias Stirner / Se <--
Copyright 2006-2016 HTW Aalen University & Matthias Stirner
All rights reserved

Segmentation fault (core dumped) 

Information obtained by using ASAN:

$ ./packJPG_asan $poc

--> packJPG v2.5k (01/22/2016) by Matthias Stirner / Se <--
Copyright 2006-2016 HTW Aalen University & Matthias Stirner
All rights reserved

AddressSanitizer:DEADLYSIGNAL                                 ]
=================================================================
==49==ERROR: AddressSanitizer: SEGV on unknown address 0x55992b5273e0 (pc 0x55992b3d3184 bp 0x55992b519d70 sp 0x7ffddbf5dd60 T0)
==49==The signal is caused by a READ memory access.
    #0 0x55992b3d3184  (/docker/packJPG-master/source/packJPG_asan+0x97184)
    #1 0x55992b3fd4c5  (/docker/packJPG-master/source/packJPG_asan+0xc14c5)
    #2 0x55992b40bb3a  (/docker/packJPG-master/source/packJPG_asan+0xcfb3a)
    #3 0x55992b3606f4  (/docker/packJPG-master/source/packJPG_asan+0x246f4)
    #4 0x7f407990e0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #5 0x55992b362c7d  (/docker/packJPG-master/source/packJPG_asan+0x26c7d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/docker/packJPG-master/source/packJPG_asan+0x97184) 
==49==ABORTING

Description

When we execute the command, asan reports the error: AddressSanitizer: SEGV on unknown address 0x55992b5273e0 (pc 0x55992b3d3184 bp 0x55992b519d70 sp 0x7ffddbf5dd60 T0).

Poc

Poc file is this.