diff --git a/src/mapogcfilter.cpp b/src/mapogcfilter.cpp index bdea8b4681..dd7998fea0 100644 --- a/src/mapogcfilter.cpp +++ b/src/mapogcfilter.cpp @@ -2238,7 +2238,7 @@ char *FLTGetLogicalComparisonSQLExpresssion(FilterEncodingNode *psFilterNode, if (!pszTmp) return NULL; - const size_t nSize = strlen(pszTmp + 1); + const size_t nSize = strlen(pszTmp) + 1; pszBuffer = (char *)malloc(nSize); snprintf(pszBuffer, nSize, "%s", pszTmp); } @@ -2258,7 +2258,7 @@ char *FLTGetLogicalComparisonSQLExpresssion(FilterEncodingNode *psFilterNode, if (!pszTmp) return NULL; - const size_t nSize = strlen(pszTmp + 1); + const size_t nSize = strlen(pszTmp) + 1; pszBuffer = (char *)malloc(nSize); snprintf(pszBuffer, nSize, "%s", pszTmp); }