[mapserver-commits] r11369 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Mar 29 17:37:41 EDT 2011


Author: tamas
Date: 2011-03-29 14:37:41 -0700 (Tue, 29 Mar 2011)
New Revision: 11369

Modified:
   trunk/mapserver/mapmssql2008.c
Log:
MSSQL2008: Prevent from the crash when the connection parameter is not specified.

Modified: trunk/mapserver/mapmssql2008.c
===================================================================
--- trunk/mapserver/mapmssql2008.c	2011-03-29 20:28:38 UTC (rev 11368)
+++ trunk/mapserver/mapmssql2008.c	2011-03-29 21:37:41 UTC (rev 11369)
@@ -356,6 +356,11 @@
         return MS_FAILURE;
     }
 
+    if(!layer->connection) {
+		msSetError( MS_QUERYERR, "MSSQL connection parameter not specified.", "msMSSQL2008LayerOpen()");
+        return MS_FAILURE;
+    }
+
     /* have to setup a connection to the database */
 
     layerinfo = (msMSSQL2008LayerInfo*) msSmallMalloc(sizeof(msMSSQL2008LayerInfo));



More information about the mapserver-commits mailing list