Merge pull request #2505 from moruoxian/main

fix: handle NULL json_str case to avoid undefined behavior
This commit is contained in:
fengzeroz
2025-06-18 14:48:50 +08:00
committed by GitHub
+3 -1
View File
@@ -1491,7 +1491,9 @@ int handle_trans_data(neu_plugin_t * plugin,
plugin, trans_data, plugin->config.format,
plugin->config.schema_vts, plugin->config.n_schema_vt,
static_tags, n_satic_tag, &skip_none);
size = strlen(json_str);
if (json_str != NULL) {
size = strlen(json_str);
}
}
if (n_satic_tag > 0) {
mqtt_static_free(static_tags, n_satic_tag);