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 leak in WritePALMImage #574

Closed
jgj212 opened this issue Jul 17, 2017 · 3 comments
Closed

memory leak in WritePALMImage #574

jgj212 opened this issue Jul 17, 2017 · 3 comments
Labels

Comments

@jgj212
Copy link
Contributor

jgj212 commented Jul 17, 2017

Version: ImageMagick 7.0.6-2 Q16 x86_64

./magick convert $FILE  out.palm

==12351==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 524288 byte(s) in 1 object(s) allocated from:
    #0 0x4deeb6 in __interceptor_malloc asan_malloc_linux.cc:66
    #1 0x7f45d5561186 in AcquireMagickMemory memory.c:464:10
    #2 0x7f45d55611e8 in AcquireQuantumMemory memory.c:537:10
    #3 0x7f45d5613951 in SetGrayscaleImage quantize.c:3322:30
    #4 0x7f45d560ffba in QuantizeImage quantize.c:2669:16
    #5 0x7f45d5299edf in SetImageType attribute.c:1293:18
    #6 0x7f45d59e181a in WritePALMImage palm.c:770:16
    #7 0x7f45d53406fe in WriteImage constitute.c:1114:14
    #8 0x7f45d53415fd in WriteImages constitute.c:1333:13
    #9 0x7f45d49ec900 in ConvertImageCommand convert.c:3280:11
    #10 0x7f45d4b3b0cf in MagickCommandGenesis mogrify.c:183:14
    #11 0x514a37 in MagickMain magick.c:149:10
    #12 0x514491 in main magick.c:180:10
    #13 0x7f45cf378f44 in __libc_start_main libc-start.c:287

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x4deeb6 in __interceptor_malloc asan_malloc_linux.cc:66
    #1 0x7f45d5561186 in AcquireMagickMemory memory.c:464:10
    #2 0x7f45d560ef4d in AcquireQuantizeInfo quantize.c:377:34
    #3 0x7f45d59e14f4 in WritePALMImage palm.c:747:17
    #4 0x7f45d53406fe in WriteImage constitute.c:1114:14
    #5 0x7f45d53415fd in WriteImages constitute.c:1333:13
    #6 0x7f45d49ec900 in ConvertImageCommand convert.c:3280:11
    #7 0x7f45d4b3b0cf in MagickCommandGenesis mogrify.c:183:14
    #8 0x514a37 in MagickMain magick.c:149:10
    #9 0x514491 in main magick.c:180:10
    #10 0x7f45cf378f44 in __libc_start_main libc-start.c:287

POC: https://github.com/jgj212/poc/blob/master/leak-WritePALM

Credit : ADLab of Venustech

@mikayla-grace
Copy link

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.

@nohmask
Copy link

nohmask commented Sep 8, 2017

This was assigned CVE-2017-12664.

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

No branches or pull requests

5 participants