Skip to content

Commit

Permalink
Ensure packet is well-formed before allocating memory for decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
jrisc committed Oct 7, 2024
1 parent 2198c5b commit 3656cc7
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 117 deletions.
4 changes: 0 additions & 4 deletions src/lib/krad/attrset.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,6 @@ kr_attrset_decode(krb5_context ctx, const krb5_data *in, const char *secret,
tmp = make_data(&in->data[i + 1], (uint8_t)in->data[i] - 2);
i += tmp.length + 1;

retval = (in->length < i) ? EBADMSG : 0;
if (retval != 0)
goto cleanup;

retval = kr_attr_decode(ctx, secret, auth, type, &tmp, buffer, &len);
if (retval != 0)
goto cleanup;
Expand Down
Loading

0 comments on commit 3656cc7

Please sign in to comment.