aboutsummaryrefslogtreecommitdiff
path: root/print-radius.c
diff options
context:
space:
mode:
authorGordon Tetlow <gordon@FreeBSD.org>2017-09-18 04:10:54 +0000
committerGordon Tetlow <gordon@FreeBSD.org>2017-09-18 04:10:54 +0000
commit4533b6d8a9b95fc043b72b3656b98e79ac839041 (patch)
tree4ac156eafa4323886af859c09363dff43cc44106 /print-radius.c
parentd79b843cb78484ea27f877f1541055e1a6a5a4d3 (diff)
Diffstat (limited to 'print-radius.c')
-rw-r--r--print-radius.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/print-radius.c b/print-radius.c
index eb48de5059bd..682cad616366 100644
--- a/print-radius.c
+++ b/print-radius.c
@@ -496,10 +496,7 @@ print_attr_string(netdissect_options *ndo,
{
case TUNNEL_PASS:
if (length < 3)
- {
- ND_PRINT((ndo, "%s", tstr));
- return;
- }
+ goto trunc;
if (*data && (*data <=0x1F) )
ND_PRINT((ndo, "Tag[%u] ", *data));
else
@@ -519,10 +516,7 @@ print_attr_string(netdissect_options *ndo,
if (*data <= 0x1F)
{
if (length < 1)
- {
- ND_PRINT((ndo, "%s", tstr));
- return;
- }
+ goto trunc;
if (*data)
ND_PRINT((ndo, "Tag[%u] ", *data));
else
@@ -532,6 +526,8 @@ print_attr_string(netdissect_options *ndo,
}
break;
case EGRESS_VLAN_NAME:
+ if (length < 1)
+ goto trunc;
ND_PRINT((ndo, "%s (0x%02x) ",
tok2str(rfc4675_tagged,"Unknown tag",*data),
*data));
@@ -540,7 +536,7 @@ print_attr_string(netdissect_options *ndo,
break;
}
- for (i=0; *data && i < length ; i++, data++)
+ for (i=0; i < length && *data; i++, data++)
ND_PRINT((ndo, "%c", (*data < 32 || *data > 126) ? '.' : *data));
return;