Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddressSanitizer report memory leaks when use the packJPG #34

Open
ConcoctionSec opened this issue Oct 10, 2021 · 0 comments
Open

AddressSanitizer report memory leaks when use the packJPG #34

ConcoctionSec opened this issue Oct 10, 2021 · 0 comments

Comments

@ConcoctionSec
Copy link

ConcoctionSec commented Oct 10, 2021

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:

  • Update Makefile:
CC = afl-gcc
CPP = afl-g++ 
LDFLAGS  =  -static-libgcc -static-libstdc++ -lstdc++fs
  • Compile program:
$ 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

Processing file  1 of  1 [                                    ]

files with errors:
------------------
/docker/packJPG-master//test/id_000012,sig_06,src_000189+000176,time_915983,op_splice,rep_2 (rst marker found out of place)
Processed  1 of  1 files [XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX]

-> 1 file(s) processed, 1 error(s), 0 warning(s)

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

Processing file  1 of  1 [                                    ]

files with errors:
------------------
/docker/packJPG-master//test/id_000012,sig_06,src_000189+000176,time_915983,op_splice,rep_2 (rst marker found out of place)
Processed  1 of  1 files [XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX]

-> 1 file(s) processed, 1 error(s), 0 warning(s)
=================================================================
==46==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f9f479e15a7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x55dbd89f93a8  (/docker/packJPG-master/source/packJPG_asan+0xa93a8)
    #2 0x62d0000003ff  (<unknown module>)

SUMMARY: AddressSanitizer: 32 byte(s) leaked in 1 allocation(s).
==========================================================================

Description

When we execute the command, asan reports the error: LeakSanitizer: detected memory leaks.

Poc

Poc file is this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant