Ticket #2196 (closed defect: fixed)
NetCDF driver segfaults when reading large attributes
| Reported by: | mariocruz | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.4.5 |
| Component: | GDAL_Raster | Version: | 1.4.4 |
| Severity: | normal | Keywords: | netcdf |
| Cc: |
Description
The NetCDF driver current implementation assumes that the length of an attribute string representation never exceeds MAX_STR_LEN characters. This assumption, together with the liberal use of strcpy/strcat causes a segfault when reading files whose attribute representation is larger than this fixed value.
The attached patch is a proposed (simple) fix for the problem which removes the length limit and allocates memory as needed by using a wrapper function around strcat.
Bug exists at least in versions 1.4.2, 1.4.4 and 1.5.0. Patched against the 1.5.0 source.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

