[PATCH] P2P: add a missing 'return' after building IE from an empty string

Eliad Peller eliad
Wed Mar 30 06:50:41 PDT 2011


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 at wizery.com>
---
 src/p2p/p2p_build.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/p2p/p2p_build.c b/src/p2p/p2p_build.c
index 42acc67..c34db91 100644
--- a/src/p2p/p2p_build.c
+++ b/src/p2p/p2p_build.c
@@ -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);
-- 
1.7.0.4




More information about the Hostap mailing list