Package: usbutils
Version: 0.72-3
Severity: important
Tags: patch, upstream
(I reported this to upstream as
http://sourceforge.net/tracker/index.php?func=detail&aid=1505941&group_id=3581&atid=303581
but reporting here anyways)
devtree.c (part of lsusb) uses strtoul with '0' for a base
argument to interpret the "T:" lines in
/proc/bus/usb/devices. However, if an entry is '09',
then it gets interepreted as an octal number (due to
the leading '0') but then gets returned as '0' (as '9'
isn't a valid character for an octal number). The
following patch makes devtree.c use base 10 for
interpreting the 'T:' lines.
-- System Information:
Debian Release: testing/unstable
APT prefers stable
APT policy: (990, 'stable'), (103, 'testing'), (102, 'unstable'), (99,
'experimental'), (97, 'dapper')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-1-686-smp
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages usbutils depends on:
ii libc6 2.3.6-13 GNU C Library: Shared libraries
ii libusb-0.1-4 2:0.1.12-2 userspace USB programming library
usbutils recommends no packages.
-- no debconf information
--- devtree.old.c 2006-06-14 12:48:20.000000000 +0200
+++ devtree.c 2006-06-14 12:48:33.000000000 +0200
@@ -144,19 +144,19 @@
switch (start[0]) {
case 'T': /* topology line */
if ((cp = strstr(start, "Dev#="))) {
- devnum = strtoul(cp + 5, NULL, 0);
+ devnum = strtoul(cp + 5, NULL, 10);
} else
devnum = 0;
if ((cp = strstr(start, "Bus="))) {
- busnum = strtoul(cp + 4, NULL, 0);
+ busnum = strtoul(cp + 4, NULL, 10);
} else
busnum = 0;
if ((cp = strstr(start, "Prnt="))) {
- parentdevnum = strtoul(cp + 5, NULL, 0);
+ parentdevnum = strtoul(cp + 5, NULL, 10);
} else
parentdevnum = 0;
if ((cp = strstr(start, "Lev="))) {
- level = strtoul(cp + 4, NULL, 0);
+ level = strtoul(cp + 4, NULL, 10);
} else
level = 0;
if (strstr(start, "Spd=1.5"))