[mapserver-commits] r11784 - branches/branch-5-6/mapserver
svn at osgeo.org
svn at osgeo.org
Sat Jun 4 12:49:00 EDT 2011
Author: rouault
Date: 2011-06-04 09:49:00 -0700 (Sat, 04 Jun 2011)
New Revision: 11784
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 (complementary fix, #3902)
Modified: branches/branch-5-6/mapserver/mapogcfilter.c
===================================================================
--- branches/branch-5-6/mapserver/mapogcfilter.c 2011-06-04 16:48:33 UTC (rev 11783)
+++ branches/branch-5-6/mapserver/mapogcfilter.c 2011-06-04 16:49:00 UTC (rev 11784)
@@ -3223,11 +3223,12 @@
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)
+ else if (FLTIsNumeric(psFilterNode->psRightNode->pszValue) == MS_FALSE)
bString = 1;
}
@@ -3444,11 +3445,12 @@
bString = 0;
if (aszBounds[0])
{
- 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(aszBounds[0]) == MS_FALSE)
+ else if (FLTIsNumeric(aszBounds[0]) == MS_FALSE)
bString = 1;
}
if (!bString)
@@ -3532,11 +3534,12 @@
bString = 0;
if (aszBounds[0])
{
- 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(aszBounds[0]) == MS_FALSE)
+ else if (FLTIsNumeric(aszBounds[0]) == MS_FALSE)
bString = 1;
}
if (!bString)
More information about the mapserver-commits
mailing list