summaryrefslogtreecommitdiffstats
path: root/tests-fuzz/fuzz_packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests-fuzz/fuzz_packet.c')
-rw-r--r--tests-fuzz/fuzz_packet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests-fuzz/fuzz_packet.c b/tests-fuzz/fuzz_packet.c
index ad9c086ab..61362c2f1 100644
--- a/tests-fuzz/fuzz_packet.c
+++ b/tests-fuzz/fuzz_packet.c
@@ -14,7 +14,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <assert.h>
#include <stdint.h>
#include "libknot/libknot.h"
@@ -25,9 +24,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
memcpy(copy, data, size);
knot_pkt_t *pkt = knot_pkt_new(copy, size, NULL);
- assert(pkt);
- knot_pkt_parse(pkt, 0);
- knot_pkt_free(pkt);
+ if (pkt != NULL) {
+ knot_pkt_parse(pkt, 0);
+ knot_pkt_free(pkt);
+ }
return 0;
}