diff -u lshw-02.16/debian/changelog lshw-02.16/debian/changelog --- lshw-02.16/debian/changelog +++ lshw-02.16/debian/changelog @@ -1,3 +1,12 @@ +lshw (02.16-2ubuntu1.4) trusty; urgency=medium + + * d/p/fix-bug653-segfault-when-usb-drive-connected.patch: + Fix situation where lshw segfaults, when there is a external + USB 3.0 drive connected to the system. (LP: #1471983) + (Cherry-picked from lshw upstream: d048d30 (presumably) fix #653) + + -- Eric Desrochers Tue, 10 Oct 2017 09:42:19 -0400 + lshw (02.16-2ubuntu1.3) trusty-proposed; urgency=medium * Backport cpuinfo support for aarch64 (LP: #1485086) diff -u lshw-02.16/debian/patches/series lshw-02.16/debian/patches/series --- lshw-02.16/debian/patches/series +++ lshw-02.16/debian/patches/series @@ -1,3 +1,4 @@ +fix-bug653-segfault-when-usb-drive-connected.patch wget.patch bin.patch lshw-gtk.patch only in patch2: unchanged: --- lshw-02.16.orig/debian/patches/fix-bug653-segfault-when-usb-drive-connected.patch +++ lshw-02.16/debian/patches/fix-bug653-segfault-when-usb-drive-connected.patch @@ -0,0 +1,23 @@ +Description: USB HDD makes lshw segfault. + In some cases, lshw segfauilt, when there is a external USB drive connected to the system. +Author: Lyonel Vincent +Origin: upstream, https://github.com/lyonel/lshw/commit/d048d300b5daeb44887a7fc06ddeb120119cac8a +Bug: http://www.ezix.org/project/ticket/653 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1471983 +Index: lshw-02.16/src/core/scsi.cc +=================================================================== +--- lshw-02.16.orig/src/core/scsi.cc ++++ lshw-02.16/src/core/scsi.cc +@@ -481,9 +481,9 @@ hwNode & node) + memset(rsp_buff, 0, sizeof(rsp_buff)); + if (do_inq(sg_fd, 0, 1, 0x80, rsp_buff, MX_ALLOC_LEN, 0)) + { +- len = rsp_buff[3]; +- if (len > 0) +- node.setSerial(hw::strip(string(rsp_buff + 4, len))); ++ char _len = rsp_buff[3]; ++ if (_len > 0) ++ node.setSerial(hw::strip(string(rsp_buff + 4, _len))); + } + + memset(rsp_buff, 0, sizeof(rsp_buff));