]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Fix AP processing without wnm_oper driver callback
authorJouni Malinen <j@w1.fi>
Fri, 27 Dec 2013 16:44:21 +0000 (18:44 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 27 Dec 2013 16:48:04 +0000 (18:48 +0200)
hostapd_drv_wnm_oper() needs to indicate an error if the driver callback
function is not implemented. Without this, the buf_len argument could
have been left uninitialized which could result in crashing the process.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/ap/ap_drv_ops.c

index bd5d8b2f6dafe95c8a0ad505b01f59ae9ffd6af3..893e6d9eee8bcc77e7ec77dc3fb96b9f06b0372e 100644 (file)
@@ -714,7 +714,7 @@ int hostapd_drv_wnm_oper(struct hostapd_data *hapd, enum wnm_oper oper,
                         const u8 *peer, u8 *buf, u16 *buf_len)
 {
        if (hapd->driver == NULL || hapd->driver->wnm_oper == NULL)
-               return 0;
+               return -1;
        return hapd->driver->wnm_oper(hapd->drv_priv, oper, peer, buf,
                                      buf_len);
 }