From cb97e271202f7612499da1c5834408ccd5c241e6 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Sun, 8 Jan 2017 19:08:54 +0100 Subject: [PATCH] MQTT: Add check that WILL topic length must be > 0 (cherry picked from commit 52f448978f78475c01ead2b9d98f9395cfe703ab) --- src/apps/mqtt/mqtt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/apps/mqtt/mqtt.c b/src/apps/mqtt/mqtt.c index c46e76af..2efd85fa 100644 --- a/src/apps/mqtt/mqtt.c +++ b/src/apps/mqtt/mqtt.c @@ -1231,6 +1231,7 @@ mqtt_client_connect(mqtt_client_t *client, const ip_addr_t *ip_addr, u16_t port, } len = strlen(client_info->will_topic); LWIP_ERROR("mqtt_client_connect: client_info->will_topic length overflow", len <= 0xFF, return ERR_VAL); + LWIP_ERROR("mqtt_client_connect: client_info->will_topic length must be > 0", len > 0, return ERR_VAL); will_topic_len = (u8_t)len; len = strlen(client_info->will_msg); LWIP_ERROR("mqtt_client_connect: client_info->will_msg length overflow", len <= 0xFF, return ERR_VAL);