summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchinglee-iot <61685396+chinglee-iot@users.noreply.github.com>2021-09-12 08:00:07 +0800
committerGitHub <noreply@github.com>2021-09-11 17:00:07 -0700
commitb4cc7670dfcb50b6a7bf5dfffe1632897bb2fc5e (patch)
tree6baa746db5b63e1c3a764bf5ada4369d57504f92
parentdfa102350411524f9c0dedf829915565e3228063 (diff)
downloadfreertos-git-b4cc7670dfcb50b6a7bf5dfffe1632897bb2fc5e.tar.gz
Fix possible null pointer dereference in Log (#677)
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
-rw-r--r--FreeRTOS-Plus/Demo/AWS/Mqtt_Demo_Helpers/mqtt_demo_helpers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/FreeRTOS-Plus/Demo/AWS/Mqtt_Demo_Helpers/mqtt_demo_helpers.c b/FreeRTOS-Plus/Demo/AWS/Mqtt_Demo_Helpers/mqtt_demo_helpers.c
index c469665df..259fa8718 100644
--- a/FreeRTOS-Plus/Demo/AWS/Mqtt_Demo_Helpers/mqtt_demo_helpers.c
+++ b/FreeRTOS-Plus/Demo/AWS/Mqtt_Demo_Helpers/mqtt_demo_helpers.c
@@ -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;