Re: [linux-usb-devel] [RFC] consolidate /sbin/hotplug call for pci and usb

From: Andi Kleen (ak@suse.de)
Date: Wed Sep 25 2002 - 19:33:50 EST


David Brownell <david-b@pacbell.net> writes:

> > + /* stuff we want to pass to /sbin/hotplug */
> > + envp[i++] = scratch;
> > + scratch += sprintf (scratch, "PCI_CLASS=%04X", pdev->class) + 1;
> > +
> > + envp[i++] = scratch;
> > + scratch += sprintf (scratch, "PCI_ID=%04X:%04X",
> > + pdev->vendor, pdev->device) + 1;
>
> And so forth. Use "snprintf" and prevent overrunning those buffers...

Hmm? An %04X format is perfectly bounded.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Sep 30 2002 - 22:00:24 EST