mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-19 14:09:05 +03:00
Merge pull request #218 from bshastry/oss-fuzz
Add coap_show_pdu() and coap_split_uri() to existing/new oss fuzz test harness
This commit is contained in:
2 files changed
+10
No files matched your search
@@ -4,7 +4,9 @@ int
|
||||
LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
coap_pdu_t *pdu = coap_pdu_init(0, 0, 0, size);
|
||||
if (pdu) {
|
||||
coap_set_log_level(LOG_DEBUG);
|
||||
coap_pdu_parse(COAP_PROTO_UDP, data, size, pdu);
|
||||
coap_show_pdu(LOG_DEBUG, pdu);
|
||||
coap_delete_pdu(pdu);
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <coap2/coap.h>
|
||||
|
||||
int
|
||||
LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
coap_uri_t uri;
|
||||
coap_split_uri(data, size, &uri);
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user