[OE-core] [PATCH] connman: fix segfault with musl >2.21

Adrian Bunk bunk at stusta.de
Thu May 23 15:31:04 UTC 2019


On Thu, May 23, 2019 at 02:56:11PM +0100, André Draszik wrote:
>...
> Also, in connman's gweb.c 'addr' is initialised to NULL. Again,
> NULL isn't anything 'returned by getaddrinfo()', so even in glibc
> it only works by pure luck.
>...

Not pure luck, free(NULL) is valid but passing random garbage to 
freeaddrinfo() would always fail.[1]

The critical point is that freeaddrinfo(NULL) working with a C library
is only an implementation detail of this specific version of the library,
not something a C library has to support according to POSIX.

> Cheers,
> Andre'

cu
Adrian

[1] unless the garbage happens to be NULL

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed



More information about the Openembedded-core mailing list