1
0
mirror of http://git.haproxy.org/git/haproxy.git/ synced 2025-03-23 11:27:01 +00:00

BUG/MINOR: Reset errno variable before calling strtol(3)

Sometimes errno != 0 before calling strtol(3)

[wt: this needs to be backported to 1.7]
This commit is contained in:
Ryabin Sergey 2017-01-11 19:39:55 +04:00 committed by Willy Tarreau
parent b732321d03
commit 77ee7526de

View File

@ -2814,6 +2814,7 @@ const char *update_server_addr_port(struct server *s, const char *addr, const ch
port_change_required = 0;
sign = *port;
errno = 0;
new_port = strtol(port, &endptr, 10);
if ((errno != 0) || (port == endptr)) {
chunk_appendf(msg, "problem converting port '%s' to an int", port);