coap_subscribe.c: Fix issue found by oss-fuzz

This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2026-05-14 15:51:32 +01:00
1 parent c1147eb096
commit 9f14450a7e
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -256,7 +256,7 @@ coap_print_status_t coap_print_wellknown_lkd(coap_context_t *context,
/**
* Check to see if a dynamic resource needs to be added.
*
* @param session Session potentiall adding a new dynamic resource.
* @param session Session potentially adding a new dynamic resource.
* @param pdu PDU that is asking for an unknown resource.
*
* @return Created resource or NULL is resource eneration not applicable.
+2 -1
View File
@@ -979,7 +979,8 @@ coap_op_dyn_resource_load_disk(coap_context_t *ctx) {
raw_packet->length, request)) {
goto fail;
}
if (!COAP_PDU_IS_REQUEST(request)) {
if (request->code == 0 || request->code > 7) {
/* Need to protect r->handler[request->code-1] */
goto next;
}
r = coap_add_dynamic_resource(session, request);