Closed kadler closed 6 years ago
Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).
Ok. Are we done with this issue?
Original comment by Teemu Halmela (Bitbucket: teemu_, GitHub: Unknown).
It was there originally because the buffer length wasn't stored and the length was calculated every time. But now it is completely useless as we get the length from outside.
Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).
Ok, i removed strlen from json_output_printf.
YIPS Super Driver - test driver - 1.1.4-sg7 toolkit - Buffer with garbage could cause problems (Halmela)
warning (i can't recall ...)
Mm ... json_output_printf seems to work with tests. I have no idea why originally added. I commented out in source for now.
Thanks (i think).
#!c
int json_output_printf(...) {
int retLen = outLen;
char *p = (char *) NULL;
char *q = (char *) NULL;
int l = 0;
int w = 0;
int printLen = 0;
va_list args;
/* Halmela asserts remove strlen will work.
if(retLen == 0){
retLen = strlen(out_caller);
}
*/
Original report by Teemu Halmela (Bitbucket: teemu_, GitHub: Unknown).
If the toolkit is given a non empty buffer the output will include content of this buffer.
This can be fixed by not taking the output length with strlen and just going with our counter. FIX and test
Note: My silly test overflows the buffer when the fix isn't applied. Maybe there should be a check for that overflow?