Menu

#487 NULL pointer dereference in ReadPALMImage

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

Here is the critical code: (in ReadPALMImage )

    lastrow = MagickAllocateMemory(unsigned char *,Max(palm_header.bytes_per_row,2*image->columns)); //1156

  mask = (1l << palm_header.bits_per_pixel) - 1;

  for (y = 0; y < (long) image->rows; y++)
    {
      if (palm_header.flags & PALM_IS_COMPRESSED_FLAG)
        {

    ...
                           one_row[i + bit] = lastrow[i + bit]; //1204
                          }
                      }
                  }
                (void) memcpy(lastrow, one_row, palm_header.bytes_per_row); //1208

MagickAllocateMemory(...) may return NULL, so the following operations on the "lastrow" 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 15193:b0b6aba92ed1. Thanks for the report!

     

Log in to post a comment.

MongoDB Logo MongoDB