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

Attempting free on address which was not malloc() #150

Open
duytai opened this issue Apr 15, 2021 · 0 comments
Open

Attempting free on address which was not malloc() #150

duytai opened this issue Apr 15, 2021 · 0 comments

Comments

@duytai
Copy link

duytai commented Apr 15, 2021

Version: img2sixel 1.8.6
Ubuntu: Ubuntu 16.04.6 LTS
Clang: 11.0.1

I compile the project with ASAN:

CXX=$(CXX) CC$(CC)= ./configure --disable-shared
AFL_USE_ASAN=1 make

and run a command to covert png to sixel:

img2sixel -i poc -o tmp.sixel

ASAN log:

libpng warning: iCCP: CRC error
=================================================================
==3043==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x0c0e00000013 in thread T0
    #0 0x49620d in free (/home/long2/sneu/libsixel/converters/img2sixel+0x49620d)
    #1 0x556f5a in load_png /home/long2/sneu/libsixel/src/loader.c:633:5
    #2 0x50f907 in load_with_builtin /home/long2/sneu/libsixel/src/loader.c:889:18
    #3 0x50f907 in sixel_helper_load_image_file /home/long2/sneu/libsixel/src/loader.c:1418:18
    #4 0x4d4cbd in sixel_encoder_encode /home/long2/sneu/libsixel/src/encoder.c:1743:14
    #5 0x4c7c8f in main /home/long2/sneu/libsixel/converters/img2sixel.c:457:22
    #6 0x7fc60028582f in __libc_start_main /build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:291
    #7 0x41c618 in _start (/home/long2/sneu/libsixel/converters/img2sixel+0x41c618)

Address 0x0c0e00000013 is located in the high shadow area.
SUMMARY: AddressSanitizer: bad-free (/home/long2/sneu/libsixel/converters/img2sixel+0x49620d) in free
==3043==ABORTING

poc.zip
Because uploading the zip failed, plz unzip file to get png image

@duytai duytai changed the title Attempting free on address which was not malloc()-ed: 0x0c0e00000013 in thread T0 Attempting free on address which was not malloc() Apr 15, 2021
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