mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-23 07:43:07 +03:00
OSS-FUZZ: Fix reported errors
This commit is contained in:
1 parent
142bc98aba
commit
2dae53cede
2 files changed
+5
-5
No files matched your search
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user