Ticket #2140 (closed defect: fixed)
SWIG ReadRaster_internal and DSReadRaster_internal may crash
| Reported by: | rouault | Owned by: | hobu |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | SWIG (all bindings) | Version: | 1.5.0 |
| Severity: | normal | Keywords: | |
| Cc: | tamas, ajolma |
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
Change History
Note: See
TracTickets for help on using
tickets.

