]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: add a missing 'return' after building IE from an empty string
authorEliad Peller <eliad@wizery.com>
Wed, 30 Mar 2011 14:08:42 +0000 (17:08 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 30 Mar 2011 14:08:42 +0000 (17:08 +0300)
When building IE from an empty string and CONFIG_WPS_STRICT is
not defined, redundant 2 bytes are being added to the string.

We have to return right after building the "dummy" string.

Signed-off-by: Eliad Peller <eliad@wizery.com>
src/p2p/p2p_build.c

index 42acc67bc05b777d0d60b38fc003b1b509abbbb7..c34db915216254df014ec4ea973e225337b46fa3 100644 (file)
@@ -346,6 +346,7 @@ static void p2p_add_wps_string(struct wpabuf *buf, enum wps_attribute attr,
                 */
                wpabuf_put_be16(buf, 1);
                wpabuf_put_u8(buf, ' ');
+               return;
        }
 #endif /* CONFIG_WPS_STRICT */
        wpabuf_put_be16(buf, len);