mfontanini / cppkafka

Modern C++ Apache Kafka client library (wrapper for librdkafka)
BSD 2-Clause "Simplified" License
600 stars 206 forks source link

Fix crash when message handle is valid but topic is null #234

Closed accelerated closed 4 years ago

accelerated commented 4 years ago

Certain RdKafka errors such as RD_KAFKA_RESP_ERR__TIMED_OUT when brokers are down or undiscoverable will cause RdKafka to raise the message receive callback with a valid message payload (it needs to contain the error number), however the key and partitions are null. If Message::get_topic() is called on such a message, this is delegated to rd_kafka_topic_name(null) which unfortunately dereferences this pointer w/o checking and crashes.

@mfontanini would be great if you can prioritize this. Thanks!

mfontanini commented 4 years ago

Thanks!