Skip to content

Commit

Permalink
Merge pull request #323 from embhorn/fix_npd
Browse files Browse the repository at this point in the history
Fix null ptr deref in MqttClient_WaitType
  • Loading branch information
dgarske authored Mar 20, 2023
2 parents 158ae8e + e622fbd commit 71f47db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ static int MqttClient_WaitType(MqttClient *client, void *packet_obj,

/* if using the shared packet object, make sure the original
* state is correct for publish payload 2 (continued) */
if (use_packet_obj != mms_stat &&
if (use_packet_obj != NULL && use_packet_obj != mms_stat &&
((MqttMsgStat*)use_packet_obj)->read == MQTT_MSG_PAYLOAD2) {
mms_stat->read = MQTT_MSG_PAYLOAD2;
}
Expand Down

0 comments on commit 71f47db

Please sign in to comment.