Package: gdal / 2.1.2+dfsg-5

svn-r36175-DODS-fix-crash-on-URL-that-are-not-DODS-servers.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Description: DODS: fix crash on URL that are not DODS servers
Author: Even Rouault <even dot rouault at spatialys dot com>
Origin: https://trac.osgeo.org/gdal/changeset/36175
Bug: https://trac.osgeo.org/gdal/ticket/6718
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gdal/+bug/1640360

--- a/frmts/dods/dodsdataset2.cpp
+++ b/frmts/dods/dodsdataset2.cpp
@@ -496,6 +496,8 @@ char **DODSDataset::CollectBandsFromDDSV
 /* -------------------------------------------------------------------- */
     BaseType *poVar = get_variable( GetDDS(), oVarName );
 
+    if( poVar == NULL )
+        return papszResultList;
     if( poVar->type() == dods_array_c )
     {
         poGrid = NULL;
@@ -1024,7 +1026,11 @@ DODSDataset::Open(GDALOpenInfo *poOpenIn
 /*      Did we get any target variables?                                */
 /* -------------------------------------------------------------------- */
         if( CSLCount(papszVarConstraintList) == 0 )
-            throw Error( "No apparent raster grids or arrays found in DDS.");
+        {
+            CPLDebug( "DODS", "No apparent raster grids or arrays found in DDS.");
+            delete poDS;
+            return NULL;
+        }
 
 /* -------------------------------------------------------------------- */
 /*      For now we support only a single band.                          */