installers: handle asprintf() correctly
authorH. Peter Anvin <hpa@zytor.com>
Fri, 2 Jul 2010 16:39:18 +0000 (09:39 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 2 Jul 2010 16:39:18 +0000 (09:39 -0700)
commitcb88d31c15a2803950e81663e4d808a31ba4f8c0
tree5b71201fa9b454ab8e4e818053455dc9f831f92b
parent63a5a1a7cac1147e80534edcef3b410e5a8119b8
installers: handle asprintf() correctly

It appears that the glibc version of asprintf() is braindamaged, and
doesn't set the target pointer to NULL in the event of an error (only
returns -1).  Therefore we need to check the return value.  Just in
case someone else made the *opposite* error, also check the pointer.

Bleh.  The glibc documentation states that *BSD sets the pointer to
NULL, but instead of following that, the glibc people put
warn_unused_result on asprintf.  Sigh.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
extlinux/main.c
libinstaller/advio.c
linux/syslinux.c