Fix MQTT data corruption on ``MQTTLog 4``

Fix MQTT data corruption on ``MQTTLog 4`` (#9571)
This commit is contained in:
Theo Arends 2020-10-19 12:46:57 +02:00
parent f79ed4464e
commit 4d9d6cd987
1 changed files with 1 additions and 1 deletions

View File

@ -222,7 +222,7 @@ bool MqttPublishLib(const char* topic, bool retained)
void MqttDumpData(char* topic, char* data, uint32_t data_len) { void MqttDumpData(char* topic, char* data, uint32_t data_len) {
char dump_data[data_len +1]; char dump_data[data_len +1];
memcpy(dump_data, mqtt_data, sizeof(dump_data)); // Make another copy for removing optional control characters memcpy(dump_data, data, sizeof(dump_data)); // Make another copy for removing optional control characters
AddLog_P2(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_MQTT D_DATA_SIZE " %d, \"%s %s\""), data_len, topic, RemoveControlCharacter(dump_data)); AddLog_P2(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_MQTT D_DATA_SIZE " %d, \"%s %s\""), data_len, topic, RemoveControlCharacter(dump_data));
} }