Skip to content

Commit

Permalink
rr_decode: Ensure we have at least a byte of data to read from
Browse files Browse the repository at this point in the history
  • Loading branch information
chouquette committed Mar 19, 2020
1 parent 162de97 commit dcfdc23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rr.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ rr_decode(const uint8_t *ptr, size_t *n, const uint8_t *root, char **ss, uint8_t
if (nb_rec > 16)
return (NULL);

if (*n == 0)
return (NULL);

s = *ss = malloc(MDNS_DN_MAXSZ);
if (!s)
return (NULL);
Expand Down

0 comments on commit dcfdc23

Please sign in to comment.