summaryrefslogtreecommitdiff
path: root/usbmisc.c
Commit message (Collapse)AuthorAgeFilesLines
* rename "GPL-2.0+" to "GPL-2.0-or-later"Greg Kroah-Hartman2021-02-221-1/+1
| | | | | | This makes `reuse lint` happy as well as license lawyers... Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usbmisc: initialize string buffer before reading from device.Greg Kroah-Hartman2020-10-221-0/+6
| | | | | | | | | | Cliff Biffle points out that some devices lie about the length of their string, so we end up with stack data in the string buffer, which is then displayed by userspace. Fix this up by initializing the data to 0 first before reading from the device. Reported-by: Cliff L. Biffle <code@cliffle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* fix up standard int typesGreg Kroah-Hartman2018-12-281-4/+4
| | | | | | | | Use the C standard uint*_t variable types, not the "unix" types of u_int*_t as we should be able to all finally agree on one type of C variables. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usbmisc: fix up some strncpy() issuesGreg Kroah-Hartman2018-05-111-3/+3
| | | | | | | | gcc-8 pointed out that this could be a problem. It really isn't, given that PATH_MAX is being used, but just to make things simpler, let strncpy() think it has a smaller buffer than it really does. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Add correct SPDX license identifiers to all filesGreg Kroah-Hartman2017-12-081-17/+3
| | | | | | | | | | This removes the "boiler-plate" license texts in the individual files to use SPDX identifiers instead. Cleans up the text a lot. All copyright notices were left intact, as this does not change anything. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* lsusb: Fix issue with lengthy string descriptorsMuthu M2015-10-041-1/+1
| | | | | | | Fixed the issue in displaying lengthy string descriptor (more than 128 bytes) Signed-off-by: Muthu M <muthu.lnx@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Ignore invalid string descriptorsPeter Wu2013-11-041-0/+3
| | | | | | | | | | | | | | | | This Ralink Wi-Fi adapter reports bogus values for some string descriptors (iSerial and iInterface). As the current libusb_get_string_descriptor function from 1.0.17 does not validate the length or type and returns 254 even if the descriptor says 0, explicitly check the fields before proceeding. Fixes the following crash: lsusb: gconv.c:74: __gconv: Assertion `outbuf != ((void *)0) && *outbuf != ((void *)0)' failed. libusbx bug: https://github.com/libusbx/libusbx/pull/156 Signed-off-by: Peter Wu <lekensteyn@gmail.com>
* lsusb: Support non-ASCII string descriptors.Роман Донченко2013-02-051-0/+94
| | | | | | | This replaces the get_string function with get_dev_string, which obtains the string descriptor in raw UTF-16 and attempts to iconv it to the current locale's encoding. If that fails, or if the system lacks the required functions, it falls back to ASCII.
* Buffer overunLukas Nykryn2012-01-111-1/+1
| | | | | | | | Because readlink() does not null-terminate buffer, only return number of written chars, thare is possibility that buf[ret] = 0; will write to unallocated area. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Remove the FSF address from the source files.Greg Kroah-Hartman2011-09-091-4/+0
| | | | | | | This keeps us from having to track the movements of them, as that's a pointless exercise. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usbutils: Fix compile error on Ubuntu 9.04.Sarah Sharp2010-12-141-0/+1
| | | | | | | | | lsusb doesn't compile for me unless I add this header file. This is an older development system (Ubuntu 9.04), so I'm not sure what combo of dev packages is to blame. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usbutils: convert to libusb-1.0Mike Frysinger2010-11-181-11/+19
| | | | | | | We need to eat our own dog food. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usbmisc: pull in unistd.h for readlink()Mike Frysinger2010-11-161-0/+1
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Include config.h before everything else.Nix2010-08-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | In a couple of cases, we fail to include config.h before all standard header files. As configure.ac specifies AC_SYS_LARGEFILE, config.h can define things like _FILE_OFFSET_BITS=64, which must be defined before all standard headers are included. Changing this in the middle of compilation confuses things like zlib, and can lead to compilation failures: In file included from names.c:42: /usr/include/32/zlib.h:1583: error: conflicting types for 'gzseek64' /usr/include/32/zlib.h:1567: note: previous declaration of 'gzseek64' was here /usr/include/32/zlib.h:1584: error: conflicting types for 'gztell64' /usr/include/32/zlib.h:1568: note: previous declaration of 'gztell64' was here /usr/include/32/zlib.h:1585: error: conflicting types for 'gzoffset64' /usr/include/32/zlib.h:1569: note: previous declaration of 'gzoffset64' was here /usr/include/32/zlib.h:1586: error: conflicting types for 'adler32_combine64' /usr/include/32/zlib.h:1570: note: previous declaration of 'adler32_combine64' was here /usr/include/32/zlib.h:1587: error: conflicting types for 'crc32_combine64' /usr/include/32/zlib.h:1571: note: previous declaration of 'crc32_combine64' was here make[1]: *** [lsusb-names.o] Error 1 The fix is to include it first. Signed-off-by: Nick Alcock <nix@esperi.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* coding style cleanups for usbmisc.cGreg Kroah-Hartman2009-09-281-25/+26
| | | | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* /proc/bus/usb -> /dev/bus/usbKay Sievers2009-04-271-2/+2
|
* fix compile warning in usbmisc.cGreg Kroah-Hartman2009-04-251-5/+4
|
* Initial revisionThomas Sailer2004-02-201-0/+141