Skip to content

Commit

Permalink
Fix crash on Tunnel-Password attributes with zero length
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Sep 7, 2009
1 parent 56903af commit 860cad9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/radius.c
Expand Up @@ -1964,6 +1964,11 @@ int rad_decode(RADIUS_PACKET *packet, RADIUS_PACKET *original,
* over-ride this one.
*/
create_pair:
/*
* Ignore VSAs that have no data.
*/
if (attrlen == 0) goto next;

pair = rad_attr2vp(packet, original, secret,
attribute, attrlen, ptr);
if (!pair) {
Expand All @@ -1976,6 +1981,7 @@ int rad_decode(RADIUS_PACKET *packet, RADIUS_PACKET *original,
*tail = pair;
tail = &pair->next;

next:
ptr += attrlen;
packet_length -= attrlen;
}
Expand Down

0 comments on commit 860cad9

Please sign in to comment.