invalid read in CreateImage on 64 bit linux
Brought to you by:
motiftools
Output of valgrind:
Invalid write of size 8
==23554== at 0x4E2C3D: CreateImage (Xpm.c:874)
==23554== by 0x4E2EA4: XmtCreatePixmapFromXmtImage (Xpm.c:1453)
==23554== by 0x4DED13: XmtLookupPixmap (Pixmap.c:293)
==23554== by 0x469932: ipe::checkBooks() (ipe.C:2235)
==23554== by 0x46A6F0: ipe::buildEnvironment() (ipe.C:1791)
==23554== by 0x46E681: ipe::ipe(_WidgetRec*) (ipe.C:158)
==23554== by 0x47576B: main (main.C:465)
In CreateImage, (unsigned long) is used to access the image data. On 64 bit platforms this is 64 bit wide and should not be used. The attached patch resolves the problem for 64-bit linux gcc-4.2.
Patch resolving the bug