Menu

#475 NULL pointer dereference in ReadEnhMetaFile

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

Here is the critical code: (in ReadEnhMetaFile)

pBits=MagickAllocateMemory(LPBYTE,dwSize); //190
  ReadFile(hFile,pBits,dwSize,&dwSize,NULL);
  CloseHandle(hFile);
  if (((PAPMHEADER) pBits)->dwKey != 0x9ac6cdd7l)
    {
      MagickFreeMemory(pBits);
      return((HENHMETAFILE) NULL);
    }

MagickAllocateMemory(...) may return NULL, so the following operations on the "pBits" will Dereference Null pointer to cause memory error.

Credit : ADLab of Venustech

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2017-09-30
    • status: open --> closed-fixed
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2017-09-30

    This problem is fixed by Mercurial changeset 15183:ea074081678b. Thanks for the report!

     

Log in to post a comment.