because decoded data may be empty
* don't care about walking off of the end of it.
*/
while (ptr < end) {
* don't care about walking off of the end of it.
*/
while (ptr < end) {
+ if (ptr[1] < 2) return -1;
+ if ((ptr + ptr[1]) > end) return -1;
+
total += ptr[1] - 2;
ptr += ptr[1];
total += ptr[1] - 2;
ptr += ptr[1];
+ if (ptr == end) break;
+
/*
* Attributes MUST be consecutive.
*/
if (ptr[0] != attr) break;
}
/*
* Attributes MUST be consecutive.
*/
if (ptr[0] != attr) break;
}
vp = fr_pair_afrom_da(ctx, da);
if (!vp) return -1;
vp = fr_pair_afrom_da(ctx, da);
if (!vp) return -1;
- while (total < vp->vp_length) {
memcpy(p, ptr + 2, ptr[1] - 2);
p += ptr[1] - 2;
total += ptr[1] - 2;
memcpy(p, ptr + 2, ptr[1] - 2);
p += ptr[1] - 2;
total += ptr[1] - 2;
attribute PMIP6-Home-IPv4-HoA = bob/8
data Failed to parse IPv4 address string "bob/8"
attribute PMIP6-Home-IPv4-HoA = bob/8
data Failed to parse IPv4 address string "bob/8"
+#
+# A "concat" attribute, with no data
+#
+decode 89 02
+data PKM-SS-Cert = 0x
+
+#
+# Or with weirdly formatted data
+#
+decode 89 03 ff 89 02 89 03 fe
+data PKM-SS-Cert = 0xfffe
+
$INCLUDE tunnel.txt
$INCLUDE errors.txt
$INCLUDE extended.txt
$INCLUDE tunnel.txt
$INCLUDE errors.txt
$INCLUDE extended.txt