eclipse-paho / paho.mqtt.embedded-c

Paho MQTT C client library for embedded systems. Paho is an Eclipse IoT project (https://iot.eclipse.org/)
https://eclipse.org/paho
Other
1.37k stars 757 forks source link

MQTTPacket_decode() doesn't present errors when it should #230

Open begincalendar opened 3 years ago

begincalendar commented 3 years ago

Is MQTTPacket_decode() intentionally implemented this way? If so, why aren't the errors (from parsing untrusted input) bubbled up?

sunnyfjk commented 1 year ago

你说的是否是MQTTDeserialize_publish函数执行时,topicName数据长度解析异常导致内存访问报错,我在MQTTDeserialize_publish之后添加了readbuf_size < topicName.lenstring.len 的比较条件暂时规避了错误,但是我对MQTT协议不是很了解不能从根源处解决问题