diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index 4264570475788be388e603c1bc70330c812d0eb3..2c47f9ec35117c73a8add4724ca8db5f0e50f0ec 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c @@ -424,6 +424,10 @@ static int nf_log_proc_dostring(struct ctl_table *table, int write, if (write) { struct ctl_table tmp = *table; + /* proc_dostring() can append to existing strings, so we need to + * initialize it as an empty string. + */ + buf[0] = '\0'; tmp.data = buf; r = proc_dostring(&tmp, write, buffer, lenp, ppos); if (r)