Ticket #2140 (closed defect: fixed)
SWIG ReadRaster_internal and DSReadRaster_internal may crash
|Reported by:||rouault||Owned by:||hobu|
|Component:||SWIG (all bindings)||Version:||1.5.0|
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).