OSS-FUZZ: Fix reported errors

This commit is contained in:
Jon Shallow committed 2026-06-13 21:03:51 +01:00
1 parent 142bc98aba
commit 2dae53cede
2 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -72,7 +72,7 @@ asn1_tag_c(const uint8_t **ptr, size_t *plen, int *constructed, int *cls) {
tag = (tag << 7) + (byte & 0x7F);
(*plen)--;
(*ptr)++;
if (*plen == 0)
if (*plen == 0 || (uint32_t)tag > (INT_MAX >> 7))
return COAP_ASN1_FAIL;
byte = (**ptr);
}
+4 -4
View File
@@ -477,11 +477,11 @@ coap_op_observe_load_disk(coap_context_t *ctx) {
if (!coap_op_observe_write(fp_new, observe_key, e_proto, e_listen_addr,
s_addr_info, raw_packet, oscore_info))
goto fail;
coap_delete_bin_const(raw_packet);
raw_packet = NULL;
coap_delete_bin_const(oscore_info);
oscore_info = NULL;
}
coap_delete_bin_const(raw_packet);
raw_packet = NULL;
coap_delete_bin_const(oscore_info);
oscore_info = NULL;
}
coap_delete_bin_const(raw_packet);
raw_packet = NULL;