From e391ccebaf3cb5c7793dd50c210fc770176d2dac Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 10 Apr 2016 22:17:28 +0200 Subject: [PATCH] Fix #27 --- hbmqtt/broker.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hbmqtt/broker.py b/hbmqtt/broker.py index a990c81..01d3a41 100644 --- a/hbmqtt/broker.py +++ b/hbmqtt/broker.py @@ -458,6 +458,9 @@ class Broker: if self.logger.isEnabledFor(logging.DEBUG): self.logger.debug("%s handling message delivery" % client_session.client_id) app_message = wait_deliver.result() + if not app_message.topic: + self.logger.warn("[MQTT-4.7.3-1] - %s invalid TOPIC sent in PUBLISH message, closing connection" % client_session.client_id) + break if "#" in app_message.topic or "+" in app_message.topic: self.logger.warn("[MQTT-3.3.2-2] - %s invalid TOPIC sent in PUBLISH message, closing connection" % client_session.client_id) break