aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-03-05 14:36:24 (GMT)
committerJouni Malinen <j@w1.fi>2017-03-05 14:37:52 (GMT)
commitb9fd3c244e8a56c988526c6d738fb677d2535f5e (patch)
tree6061d0c2ab02a26ee6e4c89c642bf7317ea9cc76 /src
parentde01f254a61a4432ba89f3a5dc950d8678021d44 (diff)
downloadhostap-b9fd3c244e8a56c988526c6d738fb677d2535f5e.zip
hostap-b9fd3c244e8a56c988526c6d738fb677d2535f5e.tar.gz
hostap-b9fd3c244e8a56c988526c6d738fb677d2535f5e.tar.bz2
tests: Add TEST_FAIL() to radius_msg_add_attr()
This makes it easier to test error paths for RADIUS message construction. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/radius/radius.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/radius/radius.c b/src/radius/radius.c
index 9ddc19b..69dbd48 100644
--- a/src/radius/radius.c
+++ b/src/radius/radius.c
@@ -631,6 +631,9 @@ struct radius_attr_hdr *radius_msg_add_attr(struct radius_msg *msg, u8 type,
size_t buf_needed;
struct radius_attr_hdr *attr;
+ if (TEST_FAIL())
+ return NULL;
+
if (data_len > RADIUS_MAX_ATTR_LEN) {
wpa_printf(MSG_ERROR, "radius_msg_add_attr: too long attribute (%lu bytes)",
(unsigned long) data_len);