Ticket #1706 (closed defect: fixed)

Opened 1 year ago

Last modified 10 months ago

[PATCH] GDAL In Memory Raster extracts invalid memory address in case the address is greater than MAX_LONG.

Reported by: ReinerBeck Assigned to: rouault
Priority: normal Milestone: 1.4.3
Component: GDAL_Raster Version: svn-trunk
Severity: major Keywords: InMemory Raster
Cc: warmerdam

Description

The problem is actually in file cpl_conv.cpp: CPLScanPointer(): In case a non-hex value is provided as the pointer for the memory image, the function "CPLScanLong()" should not be used, as it does not handle values above MAX_LONG correctly. In case the value is greater, the method returns a wrong address, resulting in a segmentation violation when accessing the image data.

Workaround: In case hex addresses are used, the address is extracted correctly.

Solution: There should be a method CPLScanULong() which should be sued.

Attachments

gdal_svn_trunk_fix1706.patch (3.0 kB) - added by rouault on 10/12/07 12:53:58.

Change History

10/12/07 12:53:38 changed by rouault

  • summary changed from GDAL In Memory Raster extracts invalid memory address in case the address is greater than MAX_LONG. to [PATCH] GDAL In Memory Raster extracts invalid memory address in case the address is greater than MAX_LONG..

I share your analysis and fix proposal. Attached a patch that implements this. (I haven't commited it as I'm not sure strtoul is available on Windows)

10/12/07 12:53:58 changed by rouault

  • attachment gdal_svn_trunk_fix1706.patch added.

10/12/07 13:07:36 changed by warmerdam

  • owner changed from warmerdam to rouault.
  • cc set to warmerdam.
  • milestone set to 1.4.3.

Even,

The patch looks ok. Go ahead and apply it in trunk and 1.4 branch please.

10/13/07 13:34:19 changed by rouault

  • status changed from new to closed.
  • resolution set to fixed.

Commited in trunk in r12406 and in 1.4 branch in r12407