mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-10 07:49:54 +00:00
BUG/MEDIUM: threads/vars: Fix deadlock in register_name
In register_name, before locking the var_names array, we check the variable name validity. So if we try to register an invalid or empty name, we need to return without unlocking it (because it was never locked). This patch must be backported in 1.8.
This commit is contained in:
parent
1714b9f286
commit
eb3e276d39
@ -174,8 +174,7 @@ static char *register_name(const char *name, int len, enum vars_scope *scope,
|
||||
/* Check length. */
|
||||
if (len == 0) {
|
||||
memprintf(err, "Empty variable name cannot be accepted");
|
||||
res = NULL;
|
||||
goto end;
|
||||
return res;
|
||||
}
|
||||
|
||||
/* Check scope. */
|
||||
@ -207,8 +206,7 @@ static char *register_name(const char *name, int len, enum vars_scope *scope,
|
||||
else {
|
||||
memprintf(err, "invalid variable name '%s'. A variable name must be start by its scope. "
|
||||
"The scope can be 'proc', 'sess', 'txn', 'req' or 'res'", name);
|
||||
res = NULL;
|
||||
goto end;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (alloc)
|
||||
|
Loading…
Reference in New Issue
Block a user