Re: [patch] kernel sysfs events layer

Robert Love
2004-08-31T22:01:09Z

On Tue, 2004-08-31 at 14:56 -0700, Andrew Morton wrote:
> Robert Love <rml@ximian.com> wrote:
> >
> > + len = strlen(object) + 1 + strlen(signal);
> > +
> > + skb = alloc_skb(len, gfp_mask);
> > + if (!skb)
> > + return -ENOMEM;
> > +
> > + buffer = skb_put(skb, len);
> > +
> > + sprintf(buffer, "%s\n%s", object, signal);
>
> Buffer overrun, methinks.

Hrm, but len is the right size...

Oh, missing the NULL, eh?

So

- len = strlen(object) + 1 + strlen(signal);
+ len = strlen(object) + 1 + strlen(signal) + 1;

should fix it, right?

Robert Love