mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-23 07:35:13 +03:00
coap_subscribe.c: Fix issue found by oss-fuzz
This commit is contained in:
1 parent
c1147eb096
commit
9f14450a7e
2 files changed
+3
-2
No files matched your search
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user