mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 14:51:27 +02:00
BUG/MINOR: tools: make str2sa_range() report unresolvable addresses
If an environment variable is used in an address, and is not set, it's silently considered as ":" or "0.0.0.0:0" which is not correct as it can hide environment issues and lead to unexpected behaviours. Let's report this case when it happens. This fix should be backported to 1.5.
This commit is contained in:
parent
72b8c1f0aa
commit
9f69f46d1f
@ -782,6 +782,11 @@ struct sockaddr_storage *str2sa_range(const char *str, int *low, int *high, char
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!*str2) {
|
||||
memprintf(err, "'%s' resolves to an empty address (environment variable missing?)\n", str);
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset(&ss, 0, sizeof(ss));
|
||||
|
||||
if (strncmp(str2, "unix@", 5) == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user