Menu

#511 Memory Allocation error due to malformed image file

v1.0_(example)
closed-fixed
1
2017-10-01
2017-09-29
No

There's a memory allocation failure due to a negative value being passed to malloc (-1) while using a specific input in the command ./gm identify -ping %file%

The relevant memory sanitizer output is as follows:

==25635== 3 errors in context 1 of 1:
==25635== Argument 'size' of function malloc has a fishy (possibly negative) value: -1
==25635==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==25635==    by 0x606A93: ReadPICTImage (pict.c:1278)
==25635==    by 0x1F70ED: ReadImage (constitute.c:1607)
==25635==    by 0x1FA1ED: PingImage (constitute.c:1370)
==25635==    by 0x1565D0: IdentifyImageCommand (command.c:8379)
==25635==    by 0x1BA8DF: MagickCommand (command.c:8869)
==25635==    by 0x1BAE15: GMCommandSingle (command.c:17396)
==25635==    by 0x1C2365: GMCommand (command.c:17449)
==25635==    by 0x56011C0: (below main) (libc-start.c:308)

The crashing input file has been shared.

1 Attachments

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2017-10-01
    • status: open --> closed-fixed
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2017-10-01

    This problem is fixed by Mercurial changeset 15214:0683f8724200. Thanks for the report!

     

Log in to post a comment.