aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/main.c
diff options
context:
space:
mode:
authorEytan Lifshitz <eytan.lifshitz@intel.com>2014-02-10 10:55:06 (GMT)
committerJouni Malinen <j@w1.fi>2014-02-13 13:58:15 (GMT)
commit1e2ffc608bb4b5085cd2dc17ba51d23c790469aa (patch)
treeb8bacfca8205e4d916dcc0f21ac2f6bc90ea7761 /hostapd/main.c
parentcbf21c7cb58de4522aa167ff144655c18897f068 (diff)
downloadhostap-1e2ffc608bb4b5085cd2dc17ba51d23c790469aa.zip
hostap-1e2ffc608bb4b5085cd2dc17ba51d23c790469aa.tar.gz
hostap-1e2ffc608bb4b5085cd2dc17ba51d23c790469aa.tar.bz2
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 <eytan.lifshitz@intel.com>
Diffstat (limited to 'hostapd/main.c')
-rw-r--r--hostapd/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index db2a455..3026929 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 ? " " : "",