Opened 16 years ago
Closed 15 years ago
#2140 closed defect (fixed)
SWIG ReadRaster_internal and DSReadRaster_internal may crash
Reported by: | Even Rouault | Owned by: | hobu |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | SWIG (all bindings) | Version: | 1.5.0 |
Severity: | normal | Keywords: | |
Cc: | tamas, Ari Jolma |
Description
Currently, no check is done on the return value of malloc. Thus it can lead to crashes when passing a NULL pointer to GDALRasterIO and GDALDatasetRasterIO. Furthermore, overflow in multiplication can occur.
The attached patch tries to address both issues. It should be improved to declare "size_t* buf_size" instead of "int *buf_size", but apparently it's not as simple as that (I've no knownledge how swig works and maps type).
Attachments (1)
Change History (4)
by , 16 years ago
Attachment: | gdal_svn_trunk_swig_vsimalloc3.patch added |
---|
comment:1 by , 16 years ago
Cc: | added |
---|
comment:2 by , 16 years ago
Patch applied in r14016.
In addition, the swig generated files should be regenerated.
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Even,
Please apply this to trunk.