Ticket #1701 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Crash reading some HDF4 files - double free of pszGCPProjection

Reported by: warmerdam Assigned to: 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

07/12/07 10:40:56 changed 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.