Skip to content

Commit 860cad9

Browse files
committed
Fix crash on Tunnel-Password attributes with zero length
1 parent 56903af commit 860cad9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: src/lib/radius.c

+6
Original file line numberDiff line numberDiff line change
@@ -1964,6 +1964,11 @@ int rad_decode(RADIUS_PACKET *packet, RADIUS_PACKET *original,
19641964
* over-ride this one.
19651965
*/
19661966
create_pair:
1967+
/*
1968+
* Ignore VSAs that have no data.
1969+
*/
1970+
if (attrlen == 0) goto next;
1971+
19671972
pair = rad_attr2vp(packet, original, secret,
19681973
attribute, attrlen, ptr);
19691974
if (!pair) {
@@ -1976,6 +1981,7 @@ int rad_decode(RADIUS_PACKET *packet, RADIUS_PACKET *original,
19761981
*tail = pair;
19771982
tail = &pair->next;
19781983

1984+
next:
19791985
ptr += attrlen;
19801986
packet_length -= attrlen;
19811987
}

0 commit comments

Comments
 (0)