[2/2] osf: fixed /proc reading bug
Sat Aug 21 23:30:17 CEST 2004
Evgeniy Polyakov wrote:
>Fixed buffer overflow when reading rules from /proc file.
How is this supposed to fix it ?
log("%s [%s]", f->genre, f->details);
- count += sprintf(buf+count, "%s - %s[%s] : %s",
+ err = snprintf(buf+count, __count-count, "%s - %s[%s] : %s",
+ if (err < 0)
+ count += err;
loga(" OPT: ");
snprintf returns the number of characters written if n <= limit, otherwise
the number of characters that would have been generated for the given input,
but never < 0. You can also use vscnprintf to get the real number of bytes
More information about the netfilter-devel