Menu

#504 null in module.c

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

Here is the critical code:

…
  path_map_iterator=MagickMapAllocateIterator(path_map);    //692

  if (IsEventLogging())
    {
      char
        list_seperator[2],
        *search_path=0;

      list_seperator[0]=DirectoryListSeparator;
      list_seperator[1]='\0';
      while(MagickMapIterateNext(path_map_iterator,&key))    //702
…

MagickMapAllocateIterator(…) may return NULL,the “iterator” was passed to MagickMapIterateNext.

in MagickMapIterateNext:

…
MagickExport unsigned int
MagickMapIterateNext(MagickMapIterator iterator,const char **key)
{
  assert(iterator != 0);                            //868
  assert(iterator->signature == MagickSignature);
  assert(key != 0);
…

If iterator is NULL,the assertion "assert(iterator !=0)" will failed.

Credit: ADLab of Venustech

Discussion

  • Bob Friesenhahn

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

    Bob Friesenhahn - 2017-10-01

    This is a duplicate of issue #502, which is now fixed.

     

Log in to post a comment.