Hi Tim, On Mon, Jan 04, 2021 at 12:58:25AM +0100, Tim Duesterhus wrote: > Willy, > Thayne, > > find the patch below. > > I am adding Thayne as CC as it was your commit that uncovered the issue and > the > crash happened in a function you wrote. Maybe you might want to add some > additional checks somewhere? > > Best regards > Tim Düsterhus > > Apply with `git am --scissors` to automatically cut the commit message. > > -- >8 -- > GitHub Issue #1026 reported a crash during configuration check for the > following example config: > > backend 0 > server 0 0 > server 0 0 > > HAProxy crashed in srv_set_addr_desc() due to a NULL pointer dereference > caused > by `sa2str` returning NULL for an `AF_UNSPEC` address (`0`).
That's embarrassing. > Fix this issue by erroring out early if the parsed address results in an > `AF_UNSPEC` family. Unfortunately we cannot do that or it destroys usage of the DNS or even any runtime address assignment over the CLI. For example if you write: server foo foo init-addr none I guess it won't work anymore since that's placed just after the address parsing. This means however that there probably is something more problematic in the referencing of address-less servers. Either servers are added/updated each time their address changes (to follow DNS) and then we can simply skip their registration when they're address-less. Or the servers are only registered at boot time, and the synchronization will fail after any address update. What do you think, Thayne ? Willy