Permalink
Browse files

Fix crash on Tunnel-Password attributes with zero length

  • Loading branch information...
1 parent 56903af commit 860cad9e02ba344edb0038419e415fe05a9a01f4 @alandekok committed Sep 7, 2009
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/lib/radius.c
View
@@ -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) {
@@ -1976,6 +1981,7 @@ int rad_decode(RADIUS_PACKET *packet, RADIUS_PACKET *original,
*tail = pair;
tail = &pair->next;
+ next:
ptr += attrlen;
packet_length -= attrlen;
}

0 comments on commit 860cad9

Please sign in to comment.