-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default MQTT Payload Parser can't handle empty messages #1975
Comments
@fooker Can you send a PR with your suggested fix? |
It looks like fixing the I've opened an associated issue in the according library: slaff/mqtt-codec#3 |
@slaff If slaff/mqtt-codec#4 gets merged, there is no need for change in Sming. Another way to solve this is not to skip the callbacks on empty messages, but make them all be called with zero length. In such a case, I will come up with a PR. |
@slaff will this be back-ported to a 4.0.x release? |
MQTT supports sending messages without a payload (the remaining bytes after the variable headers are zero). If such a message is received by the
MqttClient
and processed by the defaultMqttPayloadParser
, the client dies and does not accept any further messages.At a first sight, it looks like
malloc
is called withmessage->publish.content.length
which is0
in such a case. Thus leadingmalloc
to returnnullptr
and the following sanity-check to fail.The text was updated successfully, but these errors were encountered: