This warning is reported by cppcheck:
check-qdict.c:270: warning: scanf without field width limits can crash with huge input data
Fix it by limiting the field widths to 127 (both key and value take
127 characters + a terminating '\0' byte).
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
{
char value[128];
- if (fscanf(file, "%s%s", key, value) == EOF)
+ if (fscanf(file, "%127s%127s", key, value) == EOF) {
return NULL;
+ }
remove_dots(key);
return qstring_from_str(value);
}