lkml.org 
[lkml]   [2002]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [linux-usb-devel] [RFC] consolidate /sbin/hotplug call for pci and usb
On Wed, Sep 25, 2002 at 05:46:12PM -0700, Matthew Dharm wrote:
> On Thu, Sep 26, 2002 at 02:33:50AM +0200, Andi Kleen wrote:
> > 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.
>
> Technically, it isn't bounded. The field will expand if the value exceeds
> 4 digits.

It is bounded to 8 characters on linux systems (where int is always 32bit)

-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/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.303 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site