Menu

#506 null pointer in widget.c

v1.0_(example)
closed-fixed
None
5
2017-10-01
2017-09-25
BlueKiller
No

Here is the critical code:


                formats=MagickAllocateMemory(char **,(i+1)*sizeof(char *));        //4835
                i=0;
                for (p=magick_info; p != (MagickInfo *) NULL; p=p->next)
                {
                  if (p->stealth)
                    continue;
                  if (!p->encoder)
                    continue;
                  formats[i]=AllocateString(p->name);
                  LocaleLower((char *) formats[i]);
                  i++;
                }

MagickAllocateMemory(...) may return NULL, so the following operations on the “formats" will dereference null pointer to cause memory error.

Credit: ADLab of Venustech

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 15209:0f827e035339. Thanks for the report!

     

Log in to post a comment.

MongoDB Logo MongoDB