Fix possible null pointer dereference in Log (#677)

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
pull/684/head
chinglee-iot 3 years ago committed by GitHub
parent dfa1023504
commit b4cc7670df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -903,7 +903,7 @@ BaseType_t xPublishToTopic( MQTTContext_t * pxMqttContext,
}
else
{
LogInfo( ( "the published payload:%s \r\n ", pcPayload ) );
LogInfo( ( "the published payload:%.*s \r\n ", payloadLength, pcPayload ) );
/* This example publishes to only one topic and uses QOS1. */
outgoingPublishPackets[ ucPublishIndex ].pubInfo.qos = MQTTQoS1;
outgoingPublishPackets[ ucPublishIndex ].pubInfo.pTopicName = pcTopicFilter;

Loading…
Cancel
Save