aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius/radius_das.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-08-19 15:32:35 (GMT)
committerJouni Malinen <j@w1.fi>2012-08-19 15:32:35 (GMT)
commit236a52fd1f9c6edfa2ba4d92ebc96d826299cb17 (patch)
tree9c4f9b5cd8b480588c0d5f3da31b328307f814dc /src/radius/radius_das.c
parent75227f3adad98e8e52bf494fabbd028432825be6 (diff)
downloadhostap-236a52fd1f9c6edfa2ba4d92ebc96d826299cb17.zip
hostap-236a52fd1f9c6edfa2ba4d92ebc96d826299cb17.tar.gz
hostap-236a52fd1f9c6edfa2ba4d92ebc96d826299cb17.tar.bz2
RADIUS DAS: Verify that Error-Code attribute is added
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/radius/radius_das.c')
-rw-r--r--src/radius/radius_das.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/radius/radius_das.c b/src/radius/radius_das.c
index 8ecfffc..bded965 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 "