segfault with -t switch

Bug #592869 reported by MichalSt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
usbutils (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: usbutils

when I connect my mobile phone to usb lsusb starts to segfault with -t switch.
I tried to debug it down to the source code and found following:

when I: "cat /sys/bus/usb/devices/2-3.1/bMaxPower" (I assume this node is on of my mobile phones')
it responds with empty line. lsusb is reading this "" value and incorrectly process it in lsusb-t.c:245.
while(r) is true (r=-1 in such case) and It keeps replacing "\n" beyond the bottom limit of the buffer.
When it accidentally hit a "\n" to replace it tries to rewrite it and causes segmentation fault.

Description: Ubuntu 10.04 LTS
Release: 10.04
lsusb (usbutils) 0.86
Linux nexus 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010 x86_64 GNU/Linux

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.