Menu

#472 NULL Pointer in GetConfigureBlob

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

The code of GetConfigureBlob is here:

MagickExport void *GetConfigureBlob(const char *filename,char *path,
  size_t *length,ExceptionInfo *exception)
  {
    ...
    path_map=MagickMapAllocateMap(MagickMapCopyString,MagickMapDeallocateString);   //line 1716, allocate memory for path_map
    ...
    AddConfigurePath(path_map,&path_index,MagickShareConfigPath,exception); //line 1762, pass path_map to AddConfigurePath(...)
    ...
  }

The code of AddConfigurePath is here:

static void AddConfigurePath(MagickMap path_map, unsigned int *path_index,
  const char *path,ExceptionInfo *exception)
{
  char
    key[MaxTextExtent];

  FormatString(key,"%u",*path_index);
  (void) MagickMapAddEntry(path_map,key,(void *)path,0,exception);//line 1685, pass path_map to MagickMapAddEntry(...)
  (*path_index)++;
}

The code of MagickMapAddEntry is here:

MagickExport unsigned int
MagickMapAddEntry(MagickMap map,const char *key, const void *object,
  const size_t object_size, ExceptionInfo *exception)
{
  MagickMapObject
    *new_object;

  assert(map != 0);  //line 326, trigger assert failure because GetConfigureBlob() not perform null pointer checking but the memory allocation maybe faile
  assert(map->signature == MagickSignature);
  assert(key != 0);
  assert(object != 0);

  ...
}

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2017-09-25
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
    
     The code of GetConfigureBlob is here:
     ```
    
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2017-09-25
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     The code of GetConfigureBlob is here:
     ```
     MagickExport void *GetConfigureBlob(const char *filename,char *path,
    
    • status: open --> closed-fixed
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2017-09-25

    This problem is fixed by Mercurial changeset 15178:b27009bfd64e. Thanks for the report!

     

Log in to post a comment.

MongoDB Logo MongoDB