[PATCH v2 02/13] telemetry: fix escaping of invalid json characters
Morten Brørup
mb at smartsharesystems.com
Tue Jul 26 20:25:05 CEST 2022
> From: Bruce Richardson [mailto:bruce.richardson at intel.com]
> Sent: Monday, 25 July 2022 18.36
> To: dev at dpdk.org
> Cc: Bruce Richardson; Ciara Power; Keith Wiles
> Subject: [PATCH v2 02/13] telemetry: fix escaping of invalid json
> characters
>
> For string values returned from telemetry, escape any values that
> cannot
> normally appear in a json string. According to the json spec[1], the
> characters than need to be handled are control chars (char value <
> 0x20)
> and '"' and '\' characters.
>
> To handle this, we replace the snprintf call with a separate string
> copying and encapsulation routine which checks each character as it
> copies it to the final array.
>
> [1] https://www.rfc-editor.org/rfc/rfc8259.txt
>
> Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")
> Bugzilla ID: 1037
>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
Patchwork didn't pick up my reply to the 00/13 of the series, so I'll try again here...
Series-Acked-by: Morten Brørup <mb at smartsharesystems.com>
More information about the dev
mailing list