Skip to content

Commit

Permalink
rr_read: Fix null pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
chouquette committed Mar 19, 2020
1 parent 8c098f6 commit eab6fbb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rr.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ rr_read(const uint8_t *ptr, size_t *n, const uint8_t *root, struct rr_entry *ent

p = ptr = rr_read_RR(ptr, n, root, entry, ans);
if (ans == 0) return ptr;
if (ptr == NULL)
return (NULL);

for (size_t i = 0; i < rr_num; ++i) {
if (rrs[i].type == entry->type) {
Expand Down

0 comments on commit eab6fbb

Please sign in to comment.