telemetry: fix JSON string formatter
PATCH 1/1 telemetry: fix JSON string formatter
For large strings, we were incorrectly copying uninitialised data to the output buffer.
Restore previous code.
Fixes a515b7204e28 ("telemetry: remove VLA in JSON string formatter")
Signed-off-by David Marchand <[email protected]>
--- lib/telemetry/telemetry_json.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/telemetry/telemetry_json.h +1 -1
@@ -153,7 +153,7 @@ __json_format_str(char *buf, const int len, const char *prefix, const char *str, ret =__json_format_str_to_buf (tmp, len, prefix, str, suffix);if (ret >0 ) -strcpy (buf, saved); +strcpy (buf, tmp);free (tmp);return ret;
Signature · 1 line
2.40.1
Quoted 8 lines · David Marchand
For large strings, we were incorrectly copying uninitialised data to the output buffer.
Restore previous code.Fixes a515b7204e28 ("telemetry: remove VLA in JSON string formatter")Signed-off-by David Marchand <[email protected]>---
Acked-by Bruce Richardson <[email protected]>
Thomas Monjalon
Applied25/05/2023 10:30, Bruce Richardson:
Quoted 10 lines · David Marchand
Quoted 8 lines
For large strings, we were incorrectly copying uninitialised data to the output buffer.
Restore previous code.Fixes a515b7204e28 ("telemetry: remove VLA in JSON string formatter")Signed-off-by David Marchand <[email protected]>---
Acked-by Bruce Richardson <[email protected]>
Applied, thanks (and sorry for merging the commit triggering CI failures).