Picture of Sam 4951
Registered 5 years 4 days
Sam 4951 Tuesday, 24 November 2020, 09:21 AM
json_io encode is missing buffer length parameter
Hello,

I believe the constructor and the encode method of the json_io class are missing a bufferLength parameter, to indicate the size of the char buffer that is available for encoding.

Currently when the buffer is too small, encode just crashes.
It would be better if the encode would return an error and the required buffer size (for encoding to succeed), when the buffer is too small.

Best regards,
Sam
Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 85 days
Carmen Álvarez Méndez (innovaphone) Monday, 11 January 2021, 10:36 AM
Re: json_io encode is missing buffer length parameter
Hi Sam,

json_io crashes because of a buffer overflow when the data into the json is bigger than 64kb. Unfortunately this is currently not avoidable.

Regards,
Carmen
← You can define your color theme preference here