Skip to content

Commit

Permalink
fix null ptr crash
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemeowx2 committed Aug 30, 2019
1 parent 4000bff commit 1c26ca6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/packet.c
Expand Up @@ -86,6 +86,7 @@ void print_packet(const struct pcap_pkthdr *pkthdr, const u_char *packet)
eprintf("\n\n");
}

static u_char AnyMac[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
int packet_init(
struct packet_ctx *self,
struct lan_play *arg,
Expand All @@ -105,6 +106,8 @@ int packet_init(
CPY_IPV4(self->subnet_net, subnet_net);
CPY_IPV4(self->subnet_mask, subnet_mask);

self->mac = AnyMac;

self->identification = 0;
arp_list_init(self->arp_list);
self->arp_ttl = arp_ttl;
Expand Down

0 comments on commit 1c26ca6

Please sign in to comment.