Skip to content

Commit b6ed127

Browse files
committed
Suppress cppcheck false positive, as copy of string is required to avoid use after free
1 parent c3bc9a5 commit b6ed127

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/modsecurity.cc

+4
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,10 @@ int ModSecurity::processContentOffset(const char *content, size_t len,
262262
std::string value;
263263
yajl_gen_map_open(g);
264264
vars.pop_back();
265+
// cppcheck-suppress redundantCopyLocalConst ; copy required to avoid use after free, see commit 7cb67b0
265266
const std::string startingAt = vars.back().str();
266267
vars.pop_back();
268+
// cppcheck-suppress redundantCopyLocalConst ; copy required to avoid use after free, see commit 7cb67b0
267269
const std::string size = vars.back().str();
268270
vars.pop_back();
269271
yajl_gen_string(g,
@@ -346,8 +348,10 @@ int ModSecurity::processContentOffset(const char *content, size_t len,
346348
strlen("highlight"));
347349
yajl_gen_map_open(g);
348350
ops.pop_back();
351+
// cppcheck-suppress redundantCopyLocalConst ; copy required to avoid use after free, see commit 7cb67b0
349352
const std::string startingAt = ops.back().str();
350353
ops.pop_back();
354+
// cppcheck-suppress redundantCopyLocalConst ; copy required to avoid use after free, see commit 7cb67b0
351355
const std::string size = ops.back().str();
352356
ops.pop_back();
353357
yajl_gen_string(g,

0 commit comments

Comments
 (0)