Skip to content

Commit

Permalink
mapogcfilter.cpp: fix inappropriate buffer size (CID 1595596, fix rec…
Browse files Browse the repository at this point in the history
…ent regression of d00f54e)
  • Loading branch information
rouault committed Jul 14, 2024
1 parent b31d612 commit 1b38576
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 1b38576

Please sign in to comment.