From fe51d3335e81d734c79e85643656fda3c9e6a1a3 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Mon, 20 Jun 2022 11:17:33 +0100 Subject: [PATCH] lwip: Fix minor issues Increase MEMP_LEN_COAPSTRING to handle example server .wellknown/core request. If session cannot be generated, check for NULL pointer. --- include/coap3/lwippools.h | 2 +- src/coap_io_lwip.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/coap3/lwippools.h b/include/coap3/lwippools.h index 445bce4a..d3f39d04 100644 --- a/include/coap3/lwippools.h +++ b/include/coap3/lwippools.h @@ -66,7 +66,7 @@ #endif #ifndef MEMP_LEN_COAPSTRING -#define MEMP_LEN_COAPSTRING 32 +#define MEMP_LEN_COAPSTRING 40 #endif #ifndef MEMP_NUM_COAPCACHE_KEYS diff --git a/src/coap_io_lwip.c b/src/coap_io_lwip.c index 26179caf..5226d662 100644 --- a/src/coap_io_lwip.c +++ b/src/coap_io_lwip.c @@ -110,7 +110,8 @@ error: * https://tools.ietf.org/html/rfc7252#section-4.2 MUST send RST * https://tools.ietf.org/html/rfc7252#section-4.3 MAY send RST */ - coap_send_rst(session, pdu); + if (session) + coap_send_rst(session, pdu); coap_delete_pdu(pdu); if (packet) { packet->pbuf = NULL;