Merge pull request #2522 from ZhouBox/v2.12

[v2.12]fix: handle NULL json_str case to avoid undefined behavior
This commit is contained in:
fengzeroz
2025-07-22 15:21:04 +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);