mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 06:40:59 +01:00
BUG/MEDIUM: log: fix possible segfault during config parsing
When log format arguments are specified within braces with no '+' nor '-' prefix, the NULL string is compared with known keywords causing a crash. This only happens during parsing so it does not affect runtime processing.
This commit is contained in:
parent
9143d374e8
commit
254d44c014
@ -184,7 +184,7 @@ int parse_logformat_var_args(char *args, struct logformat_node *node)
|
|||||||
|
|
||||||
if (*args == '\0' || *args == ',') {
|
if (*args == '\0' || *args == ',') {
|
||||||
*args = '\0';
|
*args = '\0';
|
||||||
for (i = 0; var_args_list[i].name; i++) {
|
for (i = 0; sp && var_args_list[i].name; i++) {
|
||||||
if (strcmp(sp, var_args_list[i].name) == 0) {
|
if (strcmp(sp, var_args_list[i].name) == 0) {
|
||||||
if (flags == 1) {
|
if (flags == 1) {
|
||||||
node->options |= var_args_list[i].mask;
|
node->options |= var_args_list[i].mask;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user