- length = parse_subpackets(&packet->data[4],
- keyid, creation);
- parse_subpackets(&packet->data[length + 4],
- keyid, creation);
- /*
- * Don't bother to look at the unsigned packets.
- */
+ res = parse_subpackets(&packet->data[4],
+ packet->length - 4,
+ &length, keyid, creation);
+ if (res != ONAK_E_OK) {
+ return res;
+ }
+ res = parse_subpackets(&packet->data[length + 4],
+ packet->length - (4 + length),
+ &length, keyid, creation);
+ if (res != ONAK_E_OK) {
+ return res;
+ }