MQTT: Add check that WILL topic length must be > 0

(cherry picked from commit 52f448978f)
This commit is contained in:
Dirk Ziegelmeier 2017-01-08 19:08:54 +01:00 committed by goldsimon
parent 890c5982a1
commit cb97e27120

View File

@ -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);