Skip to content

Commit

Permalink
Minimum header size is 12 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
clementperon authored and mwarning committed Mar 24, 2024
1 parent 81cc8c5 commit 6f5f9d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ bool decode_msg(struct Message *msg, const uint8_t *buffer, size_t size)
{
int i;

if (size < 12)
return false;

decode_header(msg, &buffer);

if (msg->anCount != 0 || msg->nsCount != 0) {
Expand Down

0 comments on commit 6f5f9d4

Please sign in to comment.