From: Eytan Lifshitz Date: Mon, 10 Feb 2014 10:55:06 +0000 (+0200) Subject: Fix theoretical NULL dereference in debug printf X-Git-Tag: hostap_2_2~870 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1e2ffc608bb4b5085cd2dc17ba51d23c790469aa;p=thirdparty%2Fhostap.git Fix theoretical NULL dereference in debug printf In hostapd_logger_cb(), module_str is checked for NULL (on a path that does not get executed in practice), and then possibly dereferenced in snprintf() anyway. Signed-hostap: Eytan Lifshitz --- diff --git a/hostapd/main.c b/hostapd/main.c index db2a45582..30269293c 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -92,7 +92,8 @@ static void hostapd_logger_cb(void *ctx, const u8 *addr, unsigned int module, if (hapd && hapd->conf && addr) os_snprintf(format, maxlen, "%s: STA " MACSTR "%s%s: %s", hapd->conf->iface, MAC2STR(addr), - module_str ? " " : "", module_str, txt); + module_str ? " " : "", module_str ? module_str : "", + txt); else if (hapd && hapd->conf) os_snprintf(format, maxlen, "%s:%s%s %s", hapd->conf->iface, module_str ? " " : "",