Ticket #1701 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Crash reading some HDF4 files - double free of pszGCPProjection

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone: 1.4.3
Component: GDAL_Raster Version: 1.4.2
Severity: normal Keywords: hdf4
Cc:

Description

Opening and closing some HDF4 files results in heap corruption due to a double-free.

Suggested patch

warmerda@amd64[15]% svn diff hdf4imagedataset.cpp
Index: hdf4imagedataset.cpp
===================================================================
--- hdf4imagedataset.cpp        (revision 11740)
+++ hdf4imagedataset.cpp        (working copy)
@@ -1609,8 +1609,8 @@
     if ( nLatCount && nLongCount && nLatCount == nLongCount
          && pLat && pLong )
     {
-        if ( pszGCPProjection )
-            CPLFree( pszGCPProjection );
+        CPLFree( pszGCPProjection );
+        pszGCPProjection = NULL;
 
         // ASTER Level 1A
         if ( eProduct == PROD_ASTER_L1A )

Change History

Changed 5 years ago by warmerdam

  • status changed from new to closed
  • resolution set to fixed

Patch applied in trunk, 1.4.x branch and 1.4-esri branch.

Note: See TracTickets for help on using tickets.