Add WRDE_NOCMD to wordexp call

This commit is contained in:
Martin Vierula 2023-12-06 08:16:39 -08:00
parent 5b094c0ce9
commit 4c7a9bd312
No known key found for this signature in database
GPG Key ID: F2FC4E45883BCBA4
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,8 @@
v3.x.y - YYYY-MMM-DD (to be released) v3.x.y - YYYY-MMM-DD (to be released)
------------------------------------- -------------------------------------
- Add WRDE_NOCMD to wordexp call
[Issue #3024 - @sahruldotid, @martinhsv]
- Fix: validateDTD compile fails if when libxml2 not installed - Fix: validateDTD compile fails if when libxml2 not installed
[Issue #3014 - @zangobot, @martinhsv] [Issue #3014 - @zangobot, @martinhsv]
- Fix memory leak of validateDTD's dtd object - Fix memory leak of validateDTD's dtd object

View File

@ -1,6 +1,6 @@
/* /*
* ModSecurity, http://www.modsecurity.org/ * ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * Copyright (c) 2015 - 2023 Trustwave Holdings, Inc. (http://www.trustwave.com/)
* *
* You may not use this file except in compliance with * You may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
@ -130,6 +130,7 @@ std::list<std::string> expandEnv(const std::string& var, int flags) {
for (char** exp = p.gl_pathv; *exp; ++exp) { for (char** exp = p.gl_pathv; *exp; ++exp) {
#else #else
wordexp_t p; wordexp_t p;
flags = flags | WRDE_NOCMD;
if (wordexp(var.c_str(), &p, flags) == false) { if (wordexp(var.c_str(), &p, flags) == false) {
if (p.we_wordc) { if (p.we_wordc) {
for (char** exp = p.we_wordv; *exp; ++exp) { for (char** exp = p.we_wordv; *exp; ++exp) {