mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 08:48:31 -05:00
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
@ -631,6 +631,9 @@ struct radius_attr_hdr *radius_msg_add_attr(struct radius_msg *msg, u8 type,
|
|||||||
size_t buf_needed;
|
size_t buf_needed;
|
||||||
struct radius_attr_hdr *attr;
|
struct radius_attr_hdr *attr;
|
||||||
|
|
||||||
|
if (TEST_FAIL())
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (data_len > RADIUS_MAX_ATTR_LEN) {
|
if (data_len > RADIUS_MAX_ATTR_LEN) {
|
||||||
wpa_printf(MSG_ERROR, "radius_msg_add_attr: too long attribute (%lu bytes)",
|
wpa_printf(MSG_ERROR, "radius_msg_add_attr: too long attribute (%lu bytes)",
|
||||||
(unsigned long) data_len);
|
(unsigned long) data_len);
|
||||||
|
Loading…
Reference in New Issue
Block a user