diff --git a/net.c b/net.c index 32c10af8..0313aafd 100644 --- a/net.c +++ b/net.c @@ -942,9 +942,9 @@ handle_request(coap_context_t *context, coap_queue_t *node) { return; } - /* the resource was found, check if there is a registered handler */ - if (node->pdu->hdr->code < sizeof(resource->handler)) + if ((size_t)node->pdu->hdr->code < + sizeof(resource->handler)/sizeof(coap_method_handler_t)) h = resource->handler[node->pdu->hdr->code - 1]; if (h) {