Skip to content

Commit

Permalink
Merge pull request MapServer#7112 from rouault/coverity_1595596
Browse files Browse the repository at this point in the history
mapogcfilter.cpp: fix inappropriate buffer size (CID 1595596, …
  • Loading branch information
rouault authored Jul 14, 2024
2 parents b31d612 + 1b38576 commit 148c68d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mapogcfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 148c68d

Please sign in to comment.