From b2180f4a89ad2aaddb474bf5ce142fabdc6a75f4 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 10 Jan 2010 20:49:22 +0200 Subject: [PATCH] Check WPS attr build helper return value These are hardcoded to return success, but should check the value anyway. --- src/wps/wps_upnp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wps/wps_upnp.c b/src/wps/wps_upnp.c index c6ca3fee6..877b553bb 100644 --- a/src/wps/wps_upnp.c +++ b/src/wps/wps_upnp.c @@ -565,8 +565,11 @@ static struct wpabuf * build_fake_wsc_ack(void) return NULL; wpabuf_put_u8(msg, UPNP_WPS_WLANEVENT_TYPE_EAP); wpabuf_put_str(msg, "00:00:00:00:00:00"); - wps_build_version(msg); - wps_build_msg_type(msg, WPS_WSC_ACK); + if (wps_build_version(msg) || + wps_build_msg_type(msg, WPS_WSC_ACK)) { + wpabuf_free(msg); + return NULL; + } /* Enrollee Nonce */ wpabuf_put_be16(msg, ATTR_ENROLLEE_NONCE); wpabuf_put_be16(msg, WPS_NONCE_LEN);