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 function WriteMSLImage of msl.c #1360

Closed
yangming1987 opened this issue Oct 19, 2018 · 4 comments

Comments

Projects
None yet
5 participants
@yangming1987
Copy link

commented Oct 19, 2018

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am using the latest version of ImageMagick
  • I have searched open and closed issues to ensure it has not already been reported

Description

There a memroy leak in function WriteMSLImage of msl.c

Steps to Reproduce

You can reproduce this problem as below using this file. download

yangming@yang-virtual-machine:~/ImageMagick$ ./ImageMagick/utilities/magick convert ./memory_leak_msl.c.aai ./test.msl
convert: unable to read font `./memory_leak_msl.c.aai' @ error/annotate.c/RenderFreetype/1383.
convert: non-conforming drawing primitive definition `text' @ error/draw.c/RenderMVGContent/4354.
convert: unable to open image './test.msl': No such file or directory @ error/blob.c/OpenBlob/3490.
convert: unable to open file './test.msl': No such file or directory @ error/msl.c/ProcessMSLScript/7825.

=================================================================
==26979==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 13504 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83ab19e3 in AcquireCriticalMemory MagickCore/memory-private.h:64
    #3 0x563d83ab5f1b in CloneImage MagickCore/image.c:821
    #4 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #5 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #6 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #7 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #8 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #9 0x563d83aad320 in MagickMain utilities/magick.c:149
    #10 0x563d83aad5a6 in main utilities/magick.c:180
    #11 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 6144000 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09d7a0 in posix_memalign (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdf7a0)
    #1 0x563d83ae1011 in AcquireAlignedMemory MagickCore/memory.c:266
    #2 0x563d83f2589f in OpenPixelCache MagickCore/cache.c:3755
    #3 0x563d83f1d950 in GetImagePixelCache MagickCore/cache.c:1771
    #4 0x563d83f283f0 in QueueAuthenticPixelCacheNexus MagickCore/cache.c:4159
    #5 0x563d83f1bc53 in GetAuthenticPixelCacheNexus MagickCore/cache.c:1341
    #6 0x563d83f330ed in GetCacheViewAuthenticPixels MagickCore/cache-view.c:312
    #7 0x563d83ac8664 in SetImageAlpha._omp_fn.5 MagickCore/image.c:2368
    #8 0x7f8b5a162ece in GOMP_parallel (/usr/lib/x86_64-linux-gnu/libgomp.so.1+0xdece)
    #9 0x60600000109f  (<unknown module>)

Indirect leak of 13024 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83ab19e3 in AcquireCriticalMemory MagickCore/memory-private.h:64
    #3 0x563d83ab43b5 in AcquireImageInfo MagickCore/image.c:348
    #4 0x563d83ab7505 in CloneImageInfo MagickCore/image.c:942
    #5 0x563d83ab64a2 in CloneImage MagickCore/image.c:835
    #6 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #7 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #8 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #9 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #10 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #11 0x563d83aad320 in MagickMain utilities/magick.c:149
    #12 0x563d83aad5a6 in main utilities/magick.c:180
    #13 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 9096 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83f169bc in AcquireCriticalMemory MagickCore/memory-private.h:64
    #3 0x563d83f16ae5 in AcquirePixelCache MagickCore/cache.c:193
    #4 0x563d83ab2642 in AcquireImage MagickCore/image.c:206
    #5 0x563d83dfa3a4 in ReadTTFImage coders/ttf.c:214
    #6 0x563d83f78e6d in ReadImage MagickCore/constitute.c:547
    #7 0x563d83f7be47 in ReadImages MagickCore/constitute.c:922
    #8 0x563d842ee726 in ConvertImageCommand MagickWand/convert.c:643
    #9 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #10 0x563d83aad320 in MagickMain utilities/magick.c:149
    #11 0x563d83aad5a6 in main utilities/magick.c:180
    #12 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 995 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83ae1163 in AcquireQuantumMemory MagickCore/memory.c:541
    #3 0x563d83b71a74 in ConstantString MagickCore/string.c:713
    #4 0x563d83b4786a in CloneSplayTree MagickCore/splay-tree.c:373
    #5 0x563d83ef3b3a in CloneImageArtifacts MagickCore/artifact.c:118
    #6 0x563d83ab6510 in CloneImage MagickCore/image.c:838
    #7 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #8 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #9 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #10 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #11 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #12 0x563d83aad320 in MagickMain utilities/magick.c:149
    #13 0x563d83aad5a6 in main utilities/magick.c:180
    #14 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 512 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83ae1163 in AcquireQuantumMemory MagickCore/memory.c:541
    #3 0x563d83aec011 in AcquirePixelChannelMap MagickCore/pixel.c:101
    #4 0x563d83aec1a2 in ClonePixelChannelMap MagickCore/pixel.c:139
    #5 0x563d83ab6765 in CloneImage MagickCore/image.c:846
    #6 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #7 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #8 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #9 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #10 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #11 0x563d83aad320 in MagickMain utilities/magick.c:149
    #12 0x563d83aad5a6 in main utilities/magick.c:180
    #13 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 288 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83efbdb9 in AcquireCriticalMemory MagickCore/memory-private.h:64
    #3 0x563d83efcf6c in CloneBlobInfo MagickCore/blob.c:549
    #4 0x563d83ab6b01 in CloneImage MagickCore/image.c:864
    #5 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #6 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #7 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #8 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #9 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #10 0x563d83aad320 in MagickMain utilities/magick.c:149
    #11 0x563d83aad5a6 in main utilities/magick.c:180
    #12 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 176 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83ae1163 in AcquireQuantumMemory MagickCore/memory.c:541
    #3 0x563d83f1728e in AcquirePixelCacheNexus MagickCore/cache.c:265
    #4 0x563d83f16e45 in AcquirePixelCache MagickCore/cache.c:208
    #5 0x563d83ab2642 in AcquireImage MagickCore/image.c:206
    #6 0x563d83dfa3a4 in ReadTTFImage coders/ttf.c:214
    #7 0x563d83f78e6d in ReadImage MagickCore/constitute.c:547
    #8 0x563d83f7be47 in ReadImages MagickCore/constitute.c:922
    #9 0x563d842ee726 in ConvertImageCommand MagickWand/convert.c:643
    #10 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #11 0x563d83aad320 in MagickMain utilities/magick.c:149
    #12 0x563d83aad5a6 in main utilities/magick.c:180
    #13 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83b46669 in AcquireCriticalMemory MagickCore/memory-private.h:64
    #3 0x563d83b4a58d in NewSplayTree MagickCore/splay-tree.c:1148
    #4 0x563d83b4774d in CloneSplayTree MagickCore/splay-tree.c:360
    #5 0x563d83ef3b3a in CloneImageArtifacts MagickCore/artifact.c:118
    #6 0x563d83ab6510 in CloneImage MagickCore/image.c:838
    #7 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #8 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #9 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #10 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #11 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #12 0x563d83aad320 in MagickMain utilities/magick.c:149
    #13 0x563d83aad5a6 in main utilities/magick.c:180
    #14 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83b46669 in AcquireCriticalMemory MagickCore/memory-private.h:64
    #3 0x563d83b4a58d in NewSplayTree MagickCore/splay-tree.c:1148
    #4 0x563d83b4774d in CloneSplayTree MagickCore/splay-tree.c:360
    #5 0x563d83b1e263 in CloneImageProperties MagickCore/property.c:205
    #6 0x563d83ab64fd in CloneImage MagickCore/image.c:837
    #7 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #8 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #9 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #10 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #11 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #12 0x563d83aad320 in MagickMain utilities/magick.c:149
    #13 0x563d83aad5a6 in main utilities/magick.c:180
    #14 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09d7a0 in posix_memalign (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdf7a0)
    #1 0x563d83b42603 in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x563d83b426eb in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x563d83ab6c01 in CloneImage MagickCore/image.c:868
    #4 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #5 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #6 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #7 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #8 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #9 0x563d83aad320 in MagickMain utilities/magick.c:149
    #10 0x563d83aad5a6 in main utilities/magick.c:180
    #11 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09d7a0 in posix_memalign (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdf7a0)
    #1 0x563d83b42603 in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x563d83b426eb in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x563d83f02f11 in GetBlobInfo MagickCore/blob.c:1746
    #4 0x563d83efcf7c in CloneBlobInfo MagickCore/blob.c:550
    #5 0x563d83ab6b01 in CloneImage MagickCore/image.c:864
    #6 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #7 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #8 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #9 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #10 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #11 0x563d83aad320 in MagickMain utilities/magick.c:149
    #12 0x563d83aad5a6 in main utilities/magick.c:180
    #13 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09d7a0 in posix_memalign (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdf7a0)
    #1 0x563d83b42603 in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x563d83b426eb in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x563d83b4a77e in NewSplayTree MagickCore/splay-tree.c:1159
    #4 0x563d83b4774d in CloneSplayTree MagickCore/splay-tree.c:360
    #5 0x563d83ef3b3a in CloneImageArtifacts MagickCore/artifact.c:118
    #6 0x563d83ab6510 in CloneImage MagickCore/image.c:838
    #7 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #8 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #9 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #10 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #11 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #12 0x563d83aad320 in MagickMain utilities/magick.c:149
    #13 0x563d83aad5a6 in main utilities/magick.c:180
    #14 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09d7a0 in posix_memalign (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdf7a0)
    #1 0x563d83b42603 in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x563d83b426eb in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x563d83b4a77e in NewSplayTree MagickCore/splay-tree.c:1159
    #4 0x563d83b4774d in CloneSplayTree MagickCore/splay-tree.c:360
    #5 0x563d83b1e263 in CloneImageProperties MagickCore/property.c:205
    #6 0x563d83ab64fd in CloneImage MagickCore/image.c:837
    #7 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #8 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #9 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #10 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #11 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #12 0x563d83aad320 in MagickMain utilities/magick.c:149
    #13 0x563d83aad5a6 in main utilities/magick.c:180
    #14 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09d7a0 in posix_memalign (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdf7a0)
    #1 0x563d83b42603 in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x563d83b426eb in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x563d83f170be in AcquirePixelCache MagickCore/cache.c:225
    #4 0x563d83ab2642 in AcquireImage MagickCore/image.c:206
    #5 0x563d83dfa3a4 in ReadTTFImage coders/ttf.c:214
    #6 0x563d83f78e6d in ReadImage MagickCore/constitute.c:547
    #7 0x563d83f7be47 in ReadImages MagickCore/constitute.c:922
    #8 0x563d842ee726 in ConvertImageCommand MagickWand/convert.c:643
    #9 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #10 0x563d83aad320 in MagickMain utilities/magick.c:149
    #11 0x563d83aad5a6 in main utilities/magick.c:180
    #12 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09d7a0 in posix_memalign (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdf7a0)
    #1 0x563d83b42603 in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x563d83b426eb in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x563d83f1704e in AcquirePixelCache MagickCore/cache.c:223
    #4 0x563d83ab2642 in AcquireImage MagickCore/image.c:206
    #5 0x563d83dfa3a4 in ReadTTFImage coders/ttf.c:214
    #6 0x563d83f78e6d in ReadImage MagickCore/constitute.c:547
    #7 0x563d83f7be47 in ReadImages MagickCore/constitute.c:922
    #8 0x563d842ee726 in ConvertImageCommand MagickWand/convert.c:643
    #9 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #10 0x563d83aad320 in MagickMain utilities/magick.c:149
    #11 0x563d83aad5a6 in main utilities/magick.c:180
    #12 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09d7a0 in posix_memalign (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdf7a0)
    #1 0x563d83ae1011 in AcquireAlignedMemory MagickCore/memory.c:266
    #2 0x563d83f1719d in AcquirePixelCacheNexus MagickCore/cache.c:261
    #3 0x563d83f16e45 in AcquirePixelCache MagickCore/cache.c:208
    #4 0x563d83ab2642 in AcquireImage MagickCore/image.c:206
    #5 0x563d83dfa3a4 in ReadTTFImage coders/ttf.c:214
    #6 0x563d83f78e6d in ReadImage MagickCore/constitute.c:547
    #7 0x563d83f7be47 in ReadImages MagickCore/constitute.c:922
    #8 0x563d842ee726 in ConvertImageCommand MagickWand/convert.c:643
    #9 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #10 0x563d83aad320 in MagickMain utilities/magick.c:149
    #11 0x563d83aad5a6 in main utilities/magick.c:180
    #12 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 2 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83b46ba2 in AddValueToSplayTree MagickCore/splay-tree.c:189
    #3 0x563d83b478d6 in CloneSplayTree MagickCore/splay-tree.c:372
    #4 0x563d83b1e263 in CloneImageProperties MagickCore/property.c:205
    #5 0x563d83ab64fd in CloneImage MagickCore/image.c:837
    #6 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #7 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #8 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #9 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #10 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #11 0x563d83aad320 in MagickMain utilities/magick.c:149
    #12 0x563d83aad5a6 in main utilities/magick.c:180
    #13 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 52 byte(s) in 2 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83ae1163 in AcquireQuantumMemory MagickCore/memory.c:541
    #3 0x563d83b71a74 in ConstantString MagickCore/string.c:713
    #4 0x563d83b4786a in CloneSplayTree MagickCore/splay-tree.c:373
    #5 0x563d83b1e263 in CloneImageProperties MagickCore/property.c:205
    #6 0x563d83ab64fd in CloneImage MagickCore/image.c:837
    #7 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #8 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #9 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #10 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #11 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #12 0x563d83aad320 in MagickMain utilities/magick.c:149
    #13 0x563d83aad5a6 in main utilities/magick.c:180
    #14 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83b46ba2 in AddValueToSplayTree MagickCore/splay-tree.c:189
    #3 0x563d83b478d6 in CloneSplayTree MagickCore/splay-tree.c:372
    #4 0x563d83ef3b3a in CloneImageArtifacts MagickCore/artifact.c:118
    #5 0x563d83ab6510 in CloneImage MagickCore/image.c:838
    #6 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #7 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #8 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #9 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #10 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #11 0x563d83aad320 in MagickMain utilities/magick.c:149
    #12 0x563d83aad5a6 in main utilities/magick.c:180
    #13 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 24 byte(s) in 2 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83ae1163 in AcquireQuantumMemory MagickCore/memory.c:541
    #3 0x563d83b71a74 in ConstantString MagickCore/string.c:713
    #4 0x563d83b478c1 in CloneSplayTree MagickCore/splay-tree.c:372
    #5 0x563d83b1e263 in CloneImageProperties MagickCore/property.c:205
    #6 0x563d83ab64fd in CloneImage MagickCore/image.c:837
    #7 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #8 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #9 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #10 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #11 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #12 0x563d83aad320 in MagickMain utilities/magick.c:149
    #13 0x563d83aad5a6 in main utilities/magick.c:180
    #14 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x7f8b5e09cb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x563d83ae110f in AcquireMagickMemory MagickCore/memory.c:468
    #2 0x563d83ae1163 in AcquireQuantumMemory MagickCore/memory.c:541
    #3 0x563d83b71a74 in ConstantString MagickCore/string.c:713
    #4 0x563d83b478c1 in CloneSplayTree MagickCore/splay-tree.c:372
    #5 0x563d83ef3b3a in CloneImageArtifacts MagickCore/artifact.c:118
    #6 0x563d83ab6510 in CloneImage MagickCore/image.c:838
    #7 0x563d83d100d8 in WriteMSLImage coders/msl.c:8353
    #8 0x563d83f7d362 in WriteImage MagickCore/constitute.c:1231
    #9 0x563d83f7db07 in WriteImages MagickCore/constitute.c:1381
    #10 0x563d84365417 in ConvertImageCommand MagickWand/convert.c:3293
    #11 0x563d84460e0c in MagickCommandGenesis MagickWand/mogrify.c:184
    #12 0x563d83aad320 in MagickMain utilities/magick.c:149
    #13 0x563d83aad5a6 in main utilities/magick.c:180
    #14 0x7f8b597cfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: 6182395 byte(s) leaked in 25 allocation(s).

System Configuration

  • ImageMagick version:
    Version: ImageMagick 7.0.8-13 Q16 x86_64 2018-10-19 https://imagemagick.org
    Copyright: © 1999-2018 ImageMagick Studio LLC
    License: https://imagemagick.org/script/license.php
    Features: Cipher DPC HDRI OpenMP
    Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr lzma openexr pangocairo png tiff wmf x xml zlib
  • Environment (Operating system, version and so on):
    Linux test-virtual-machine 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Additional information:

@dlemstra dlemstra added the bug label Oct 20, 2018

dlemstra added a commit that referenced this issue Oct 20, 2018

@dlemstra

This comment has been minimized.

Copy link
Member

commented Oct 20, 2018

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 @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

@nohmask

This comment has been minimized.

Copy link

commented Oct 22, 2018

This was assigned CVE-2018-18544.

@bastien-roucaries

This comment has been minimized.

Copy link

commented Oct 29, 2018

We need the im6 commit if appliable

@dlemstra

This comment has been minimized.

Copy link
Member

commented Oct 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.