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>
This commit is contained in:
parent
de01f254a6
commit
b9fd3c244e
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue