]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: config: fix parser crash with bad bind or server address
authorSean Carey <carey@basho.com>
Fri, 15 Feb 2013 22:39:18 +0000 (23:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Feb 2013 22:39:18 +0000 (23:39 +0100)
If an address is improperly formated on a bind or server address
and haproxy is built for using getaddrinfo, then a crash may occur
upon the call to freeaddrinfo().

Thanks to Jon Meredith for helping me patch this for SmartOS,
I am not a C/GDB wizard.

src/standard.c

index b14b70ba2787b7f2c4a772da0cc3575678533939..380f7bedcca8e6db4c2ffc15843dd1a877ae28d9 100644 (file)
@@ -600,7 +600,8 @@ struct sockaddr_storage *str2ip(const char *str)
                        }
                }
 
-               freeaddrinfo(result);
+               if (result)
+                       freeaddrinfo(result);
        }
 #endif
        /* unsupported address family */