Opened 17 years ago
Closed 17 years ago
#1706 closed defect (fixed)
[PATCH] GDAL In Memory Raster extracts invalid memory address in case the address is greater than MAX_LONG.
Reported by: | ReinerBeck | Owned by: | Even 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 (1)
Change History (4)
comment:1 by , 17 years ago
Summary: | GDAL In Memory Raster extracts invalid memory address in case the address is greater than MAX_LONG. → [PATCH] GDAL In Memory Raster extracts invalid memory address in case the address is greater than MAX_LONG. |
---|
by , 17 years ago
Attachment: | gdal_svn_trunk_fix1706.patch added |
---|
comment:2 by , 17 years ago
Cc: | added |
---|---|
Milestone: | → 1.4.3 |
Owner: | changed from | to
Even,
The patch looks ok. Go ahead and apply it in trunk and 1.4 branch please.
comment:3 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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)