mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-01 23:45:48 +03:00
OSS-Fuzz: Fix packet transmission checking for network related fuzzers
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
This commit is contained in:
1 parent
407e6b06cf
commit
efec6cf653
4 files changed
+8
-4
No files matched your search
@@ -51,7 +51,8 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
|
||||
coap_startup();
|
||||
coap_set_log_level(COAP_LOG_EMERG);
|
||||
coap_debug_set_packet_loss("100%");
|
||||
coap_debug_set_packet_loss("50%");
|
||||
coap_debug_set_packet_fail("100%");
|
||||
|
||||
ctx = coap_new_context(NULL);
|
||||
if (!ctx)
|
||||
|
||||
@@ -224,7 +224,8 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
/* Initialize CoAP library */
|
||||
coap_startup();
|
||||
coap_set_log_level(COAP_LOG_EMERG);
|
||||
coap_debug_set_packet_loss("100%");
|
||||
coap_debug_set_packet_loss("50%");
|
||||
coap_debug_set_packet_fail("100%");
|
||||
|
||||
/* Setup local address */
|
||||
coap_address_init(&local_addr);
|
||||
|
||||
@@ -20,7 +20,8 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
|
||||
coap_startup();
|
||||
coap_set_log_level(COAP_LOG_EMERG);
|
||||
coap_debug_set_packet_loss("100%");
|
||||
coap_debug_set_packet_loss("50%");
|
||||
coap_debug_set_packet_fail("100%");
|
||||
|
||||
coap_context_t *ctx = coap_new_context(NULL);
|
||||
if (!ctx)
|
||||
|
||||
@@ -26,7 +26,8 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
coap_oscore_conf_t *oscore_conf = coap_new_oscore_conf(conf, NULL, NULL, 0);
|
||||
|
||||
/* Stop transmission of any error packets */
|
||||
coap_debug_set_packet_loss("1-10");
|
||||
coap_debug_set_packet_loss("50%");
|
||||
coap_debug_set_packet_fail("100%");
|
||||
|
||||
/* Set up OSCORE context */
|
||||
ctx = coap_new_context(NULL);
|
||||
|
||||
Reference in new issue
Block a user