[mapserver-commits] r11077 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri Mar 4 16:38:28 EST 2011


Author: tamas
Date: 2011-03-04 13:38:28 -0800 (Fri, 04 Mar 2011)
New Revision: 11077

Modified:
   trunk/mapserver/maporaclespatial.c
Log:
Avoid the crash if 'using unique' is not specified with the oracle driver

Modified: trunk/mapserver/maporaclespatial.c
===================================================================
--- trunk/mapserver/maporaclespatial.c	2011-03-04 20:50:28 UTC (rev 11076)
+++ trunk/mapserver/maporaclespatial.c	2011-03-04 21:38:28 UTC (rev 11077)
@@ -1998,11 +1998,14 @@
 
     /* Check if the unique field is already in the items list */
     existunique = MS_FALSE;
-    for( i=0; i < layer->numitems; ++i ) {
-        if (strcasecmp(unique, layer->items[i])==0) {
-            sthand->uniqueidindex = i;
-            existunique = MS_TRUE;
-            break;
+    if (unique)
+    {
+        for( i=0; i < layer->numitems; ++i ) {
+            if (strcasecmp(unique, layer->items[i])==0) {
+                sthand->uniqueidindex = i;
+                existunique = MS_TRUE;
+                break;
+            }
         }
     }
 



More information about the mapserver-commits mailing list