[mapserver-commits] r11781 - branches/branch-5-6/mapserver

svn at osgeo.org svn at osgeo.org
Sat Jun 4 12:32:24 EDT 2011


Author: rouault
Date: 2011-06-04 09:32:24 -0700 (Sat, 04 Jun 2011)
New Revision: 11781

Modified:
   branches/branch-5-6/mapserver/mapogcfilter.c
Log:
OGC Filter: fix segfault when a ows_varname_type or wfs_varname_type is defined but not a gml_varname_type (#3902)

Modified: branches/branch-5-6/mapserver/mapogcfilter.c
===================================================================
--- branches/branch-5-6/mapserver/mapogcfilter.c	2011-06-04 16:32:12 UTC (rev 11780)
+++ branches/branch-5-6/mapserver/mapogcfilter.c	2011-06-04 16:32:24 UTC (rev 11781)
@@ -3321,9 +3321,10 @@
     bString = 0;
     if (psFilterNode->psRightNode->pszValue)
     {
-        sprintf(szTmp, "%s_type",  psFilterNode->psLeftNode->pszValue);
-        if (msOWSLookupMetadata(&(lp->metadata), "OFG", szTmp) != NULL &&
-            (strcasecmp(msOWSLookupMetadata(&(lp->metadata), "G", szTmp), "Character") == 0))
+        const char* pszOFGType;
+        snprintf(szTmp, sizeof(szTmp), "%s_type",  psFilterNode->psLeftNode->pszValue);
+        pszOFGType = msOWSLookupMetadata(&(lp->metadata), "OFG", szTmp);
+        if (pszOFGType != NULL && strcasecmp(pszOFGType, "Character") == 0)
           bString = 1;
 
         else if (FLTIsNumeric(psFilterNode->psRightNode->pszValue) == MS_FALSE)    



More information about the mapserver-commits mailing list