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

memory leaks detected in image_buffer_resize at fromsixel.c:357 #119

Closed
SuhwanSong opened this issue Dec 17, 2019 · 2 comments
Closed

memory leaks detected in image_buffer_resize at fromsixel.c:357 #119

SuhwanSong opened this issue Dec 17, 2019 · 2 comments

Comments

@SuhwanSong
Copy link

img2sixel 1.8.3 (git commit 41f6be4)

There is a memory leak in image_buffer_resize at fromsixel.c:357
please run following cmd to reproduce it.

img2sixel --monochrome $PoC

poc
ASAN LOG

==4360==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 551816704 byte(s) in 1 object(s) allocated from:
    #0 0x4da230 in __interceptor_malloc (/home/tmp/img2sixel+0x4da230)
    #1 0x7f326c6e7c68 in image_buffer_resize /home/tmp/libsixel/src/fromsixel.c:357:35

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

@saitoha
Copy link
Owner

saitoha commented Dec 17, 2019

I can't reproduce it. Could you tell me your environment information?

$ uname -a
Darwin mbp4 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64 x86_64
$ git checkout 41f6be4
$ CC=gcc-7 CFLAGS="-O0 -g -fsanitize=address,leak -fno-omit-frame-pointer" LDFLAGS="-lasan " LDADD="-static-libasan " ./configure && make install
$ img2sixel --version | head -n9
img2sixel 1.8.3

configured with:
  libcurl: yes
  libpng: yes
  libjpeg: yes
  gdk-pixbuf2: no
  GD: no

$ img2sixel --monochrome -- ~/Downloads/id_000014,sig_06,src_000472+001420,op_splice,rep_16
runtime error: bad input detected
image_buffer_init: given height parameter is too huge.

@saitoha
Copy link
Owner

saitoha commented Jan 3, 2020

Fixed on v1.8.5. Thanks!

@saitoha saitoha closed this as completed Jan 3, 2020
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

2 participants