diff --git a/src/packet/packet_utils.cpp b/src/packet/packet_utils.cpp index 873b224..708603f 100644 --- a/src/packet/packet_utils.cpp +++ b/src/packet/packet_utils.cpp @@ -445,7 +445,7 @@ uint16_t packet_get_raw_len(const struct packet *pkt) const char *packet_get_payload(const struct packet *pkt) { - if (pkt->layers_used == 0) + if (pkt == NULL || pkt->layers_used == 0) { return NULL; } @@ -462,7 +462,7 @@ const char *packet_get_payload(const struct packet *pkt) uint16_t packet_get_payload_len(const struct packet *pkt) { - if (pkt->layers_used == 0) + if (pkt==NULL || pkt->layers_used == 0) { return 0; }