From 793940d283ceea185be3a96dba62243063152268 Mon Sep 17 00:00:00 2001 From: Bhargava Shastry Date: Wed, 27 Jun 2018 11:23:23 +0200 Subject: [PATCH] oss-fuzz: Move test from oss-fuzz repo --- tests/oss-fuzz/pdu_parse_target.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/oss-fuzz/pdu_parse_target.c diff --git a/tests/oss-fuzz/pdu_parse_target.c b/tests/oss-fuzz/pdu_parse_target.c new file mode 100644 index 00000000..b37d7886 --- /dev/null +++ b/tests/oss-fuzz/pdu_parse_target.c @@ -0,0 +1,11 @@ +#include + +int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + coap_pdu_t *pdu = coap_pdu_init(0, 0, 0, size); + if (!pdu) return 0; + + coap_pdu_parse(COAP_PROTO_UDP, data, size, pdu); + coap_delete_pdu(pdu); + return 0; +}