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 in ReadPICTImage #879

Closed
henices opened this Issue Nov 24, 2017 · 2 comments

Comments

Projects
None yet
4 participants
@henices
Copy link
Contributor

henices commented Nov 24, 2017

$ magick -version
Version: ImageMagick 7.0.7-12 Q16 x86_64 2017-11-21 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP
Delegates (built-in): bzlib fontconfig freetype jng jpeg lzma pangocairo png tiff x xml zlib

Trigger Command: magick ReadPICTImage-memory-leaks /dev/null

magick: width or height exceeds limit `ReadPICTImage-memory-leaks' @ error/cache.c/OpenPixelCache/3484.

=================================================================
==13146==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 13488 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b569850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7f4b7a97e3cc in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7f4b7a938f91 in AcquireCriticalMemory MagickCore/memory-private.h:57
    #3 0x7f4b7a9395a2 in AcquireImage MagickCore/image.c:170
    #4 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #5 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #6 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #7 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #8 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #9 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #10 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #11 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #12 0x401a36 in MagickMain utilities/magick.c:149
    #13 0x401ca0 in main utilities/magick.c:180
    #14 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 13024 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b569850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7f4b7a97e3cc in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7f4b7a938f91 in AcquireCriticalMemory MagickCore/memory-private.h:57
    #3 0x7f4b7a93b93e in AcquireImageInfo MagickCore/image.c:346
    #4 0x7f4b7a93ea7f in CloneImageInfo MagickCore/image.c:947
    #5 0x7f4b7a94d53b in SyncImageSettings MagickCore/image.c:4056
    #6 0x7f4b7a93b366 in AcquireImage MagickCore/image.c:289
    #7 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #8 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #9 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #10 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #11 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #12 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #13 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #14 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #15 0x401a36 in MagickMain utilities/magick.c:149
    #16 0x401ca0 in main utilities/magick.c:180
    #17 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 9096 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b569850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7f4b7a97e3cc in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7f4b7a73b317 in AcquireCriticalMemory MagickCore/memory-private.h:57
    #3 0x7f4b7a73b440 in AcquirePixelCache MagickCore/cache.c:192
    #4 0x7f4b7a939be0 in AcquireImage MagickCore/image.c:205
    #5 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #6 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #7 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #8 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #9 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #10 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #11 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #12 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #13 0x401a36 in MagickMain utilities/magick.c:149
    #14 0x401ca0 in main utilities/magick.c:180
    #15 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 704 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b569850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7f4b7a97e3cc in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7f4b7a97e420 in AcquireQuantumMemory MagickCore/memory.c:537
    #3 0x7f4b7a73bba6 in AcquirePixelCacheNexus MagickCore/cache.c:263
    #4 0x7f4b7a73b75d in AcquirePixelCache MagickCore/cache.c:206
    #5 0x7f4b7a939be0 in AcquireImage MagickCore/image.c:205
    #6 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #7 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #8 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #9 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #10 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #11 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #12 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #13 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #14 0x401a36 in MagickMain utilities/magick.c:149
    #15 0x401ca0 in main utilities/magick.c:180
    #16 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 512 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b569850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7f4b7a97e3cc in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7f4b7a97e420 in AcquireQuantumMemory MagickCore/memory.c:537
    #3 0x7f4b7a9b40f3 in AcquirePixelChannelMap MagickCore/pixel.c:101
    #4 0x7f4b7a939c69 in AcquireImage MagickCore/image.c:207
    #5 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #6 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #7 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #8 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #9 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #10 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #11 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #12 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #13 0x401a36 in MagickMain utilities/magick.c:149
    #14 0x401ca0 in main utilities/magick.c:180
    #15 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 280 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b569850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7f4b7a97e3cc in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7f4b7a721dca in AcquireCriticalMemory MagickCore/memory-private.h:57
    #3 0x7f4b7a722f55 in CloneBlobInfo MagickCore/blob.c:542
    #4 0x7f4b7a939cae in AcquireImage MagickCore/image.c:208
    #5 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #6 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #7 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #8 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #9 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #10 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #11 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #12 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #13 0x401a36 in MagickMain utilities/magick.c:149
    #14 0x401ca0 in main utilities/magick.c:180
    #15 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b569850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7f4b7a97e3cc in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7f4b7aa8805d in AcquireCriticalMemory MagickCore/memory-private.h:57
    #3 0x7f4b7aa8bf85 in NewSplayTree MagickCore/splay-tree.c:1148
    #4 0x7f4b7aa89145 in CloneSplayTree MagickCore/splay-tree.c:360
    #5 0x7f4b7a9a3eaa in CloneImageOptions MagickCore/option.c:1883
    #6 0x7f4b7a9400ed in CloneImageInfo MagickCore/image.c:1012
    #7 0x7f4b7a94d53b in SyncImageSettings MagickCore/image.c:4056
    #8 0x7f4b7a93b366 in AcquireImage MagickCore/image.c:289
    #9 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #10 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #11 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #12 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #13 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #14 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #15 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #16 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #17 0x401a36 in MagickMain utilities/magick.c:149
    #18 0x401ca0 in main utilities/magick.c:180
    #19 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b56a4a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7f4b7aa747bd in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x7f4b7aa748a7 in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x7f4b7a73b9d6 in AcquirePixelCache MagickCore/cache.c:223
    #4 0x7f4b7a939be0 in AcquireImage MagickCore/image.c:205
    #5 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #6 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #7 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #8 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #9 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #10 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #11 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #12 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #13 0x401a36 in MagickMain utilities/magick.c:149
    #14 0x401ca0 in main utilities/magick.c:180
    #15 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b56a4a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7f4b7aa747bd in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x7f4b7aa748a7 in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x7f4b7a73b966 in AcquirePixelCache MagickCore/cache.c:221
    #4 0x7f4b7a939be0 in AcquireImage MagickCore/image.c:205
    #5 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #6 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #7 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #8 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #9 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #10 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #11 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #12 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #13 0x401a36 in MagickMain utilities/magick.c:149
    #14 0x401ca0 in main utilities/magick.c:180
    #15 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b56a4a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7f4b7aa747bd in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x7f4b7aa748a7 in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x7f4b7aa8c176 in NewSplayTree MagickCore/splay-tree.c:1159
    #4 0x7f4b7aa89145 in CloneSplayTree MagickCore/splay-tree.c:360
    #5 0x7f4b7a9a3eaa in CloneImageOptions MagickCore/option.c:1883
    #6 0x7f4b7a9400ed in CloneImageInfo MagickCore/image.c:1012
    #7 0x7f4b7a94d53b in SyncImageSettings MagickCore/image.c:4056
    #8 0x7f4b7a93b366 in AcquireImage MagickCore/image.c:289
    #9 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #10 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #11 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #12 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #13 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #14 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #15 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #16 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #17 0x401a36 in MagickMain utilities/magick.c:149
    #18 0x401ca0 in main utilities/magick.c:180
    #19 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b56a4a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7f4b7a97e2cc in AcquireAlignedMemory MagickCore/memory.c:262
    #2 0x7f4b7a73bab5 in AcquirePixelCacheNexus MagickCore/cache.c:259
    #3 0x7f4b7a73b75d in AcquirePixelCache MagickCore/cache.c:206
    #4 0x7f4b7a939be0 in AcquireImage MagickCore/image.c:205
    #5 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #6 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #7 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #8 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #9 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #10 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #11 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #12 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #13 0x401a36 in MagickMain utilities/magick.c:149
    #14 0x401ca0 in main utilities/magick.c:180
    #15 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b56a4a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7f4b7aa747bd in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x7f4b7aa748a7 in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x7f4b7a939dbc in AcquireImage MagickCore/image.c:212
    #4 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #5 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #6 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #7 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #8 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #9 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #10 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #11 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #12 0x401a36 in MagickMain utilities/magick.c:149
    #13 0x401ca0 in main utilities/magick.c:180
    #14 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b56a4a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7f4b7aa747bd in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x7f4b7aa748a7 in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x7f4b7a7286b4 in GetBlobInfo MagickCore/blob.c:1628
    #4 0x7f4b7a722f65 in CloneBlobInfo MagickCore/blob.c:543
    #5 0x7f4b7a939cae in AcquireImage MagickCore/image.c:208
    #6 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #7 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #8 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #9 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #10 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #11 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #12 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #13 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #14 0x401a36 in MagickMain utilities/magick.c:149
    #15 0x401ca0 in main utilities/magick.c:180
    #16 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b569850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7f4b7a97e3cc in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7f4b7aa88596 in AddValueToSplayTree MagickCore/splay-tree.c:189
    #3 0x7f4b7aa892ce in CloneSplayTree MagickCore/splay-tree.c:372
    #4 0x7f4b7a9a3eaa in CloneImageOptions MagickCore/option.c:1883
    #5 0x7f4b7a9400ed in CloneImageInfo MagickCore/image.c:1012
    #6 0x7f4b7a94d53b in SyncImageSettings MagickCore/image.c:4056
    #7 0x7f4b7a93b366 in AcquireImage MagickCore/image.c:289
    #8 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #9 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #10 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #11 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #12 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #13 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #14 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #15 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #16 0x401a36 in MagickMain utilities/magick.c:149
    #17 0x401ca0 in main utilities/magick.c:180
    #18 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 27 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b569850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7f4b7a97e3cc in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7f4b7a97e420 in AcquireQuantumMemory MagickCore/memory.c:537
    #3 0x7f4b7aab2fe3 in ConstantString MagickCore/string.c:700
    #4 0x7f4b7aa89262 in CloneSplayTree MagickCore/splay-tree.c:373
    #5 0x7f4b7a9a3eaa in CloneImageOptions MagickCore/option.c:1883
    #6 0x7f4b7a9400ed in CloneImageInfo MagickCore/image.c:1012
    #7 0x7f4b7a94d53b in SyncImageSettings MagickCore/image.c:4056
    #8 0x7f4b7a93b366 in AcquireImage MagickCore/image.c:289
    #9 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #10 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #11 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #12 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #13 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #14 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #15 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #16 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #17 0x401a36 in MagickMain utilities/magick.c:149
    #18 0x401ca0 in main utilities/magick.c:180
    #19 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

Indirect leak of 9 byte(s) in 1 object(s) allocated from:
    #0 0x7f4b7b569850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7f4b7a97e3cc in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7f4b7a97e420 in AcquireQuantumMemory MagickCore/memory.c:537
    #3 0x7f4b7aab2fe3 in ConstantString MagickCore/string.c:700
    #4 0x7f4b7aa892b9 in CloneSplayTree MagickCore/splay-tree.c:372
    #5 0x7f4b7a9a3eaa in CloneImageOptions MagickCore/option.c:1883
    #6 0x7f4b7a9400ed in CloneImageInfo MagickCore/image.c:1012
    #7 0x7f4b7a94d53b in SyncImageSettings MagickCore/image.c:4056
    #8 0x7f4b7a93b366 in AcquireImage MagickCore/image.c:289
    #9 0x7f4b7acfd76d in ReadPICTImage coders/pict.c:867
    #10 0x7f4b7a7b13cf in ReadImage MagickCore/constitute.c:497
    #11 0x7f4b7a7b4298 in ReadImages MagickCore/constitute.c:866
    #12 0x7f4b7a20c86a in CLINoImageOperator MagickWand/operation.c:4763
    #13 0x7f4b7a20fb72 in CLIOption MagickWand/operation.c:5258
    #14 0x7f4b7a0b85f8 in ProcessCommandOptions MagickWand/magick-cli.c:424
    #15 0x7f4b7a0b9ea0 in MagickImageCommand MagickWand/magick-cli.c:794
    #16 0x7f4b7a0f30e6 in MagickCommandGenesis MagickWand/mogrify.c:183
    #17 0x401a36 in MagickMain utilities/magick.c:149
    #18 0x401ca0 in main utilities/magick.c:180
    #19 0x7f4b76288889 in __libc_start_main (/lib64/libc.so.6+0x20889)

SUMMARY: AddressSanitizer: 37644 byte(s) leaked in 16 allocation(s).

testcase:
https://github.com/henices/pocs/raw/master/ReadPICTImage-memory-leaks

Credit: NSFocus Security Team <security (at) nsfocus (dot) com>

urban-warrior pushed a commit that referenced this issue Nov 24, 2017

Cristy

urban-warrior pushed a commit that referenced this issue Nov 24, 2017

Cristy
@urban-warrior

This comment has been minimized.

Copy link
Contributor

urban-warrior commented Nov 24, 2017

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.

@dlemstra dlemstra added the bug label Nov 24, 2017

@dlemstra dlemstra closed this Nov 24, 2017

@nohmask

This comment has been minimized.

Copy link

nohmask commented Dec 25, 2017

This was assigned CVE-2017-17885.

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