From: Jouni Malinen Date: Sun, 19 Aug 2012 15:32:35 +0000 (+0300) Subject: RADIUS DAS: Verify that Error-Code attribute is added X-Git-Tag: hostap_2_0~371 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=236a52fd1f9c6edfa2ba4d92ebc96d826299cb17;p=thirdparty%2Fhostap.git RADIUS DAS: Verify that Error-Code attribute is added Signed-hostap: Jouni Malinen --- diff --git a/src/radius/radius_das.c b/src/radius/radius_das.c index 8ecfffc97..bded96519 100644 --- a/src/radius/radius_das.c +++ b/src/radius/radius_das.c @@ -127,8 +127,11 @@ fail: return NULL; if (error) { - radius_msg_add_attr_int32(reply, RADIUS_ATTR_ERROR_CAUSE, - error); + if (!radius_msg_add_attr_int32(reply, RADIUS_ATTR_ERROR_CAUSE, + error)) { + radius_msg_free(reply); + return NULL; + } } return reply; @@ -225,7 +228,12 @@ static void radius_das_receive(int sock, void *eloop_ctx, void *sock_ctx) break; /* Unsupported Service */ - radius_msg_add_attr_int32(reply, RADIUS_ATTR_ERROR_CAUSE, 405); + if (!radius_msg_add_attr_int32(reply, RADIUS_ATTR_ERROR_CAUSE, + 405)) { + radius_msg_free(reply); + reply = NULL; + break; + } break; default: wpa_printf(MSG_DEBUG, "DAS: Unexpected RADIUS code %u in "