diff -u lshw-02.17/debian/changelog lshw-02.17/debian/changelog --- lshw-02.17/debian/changelog +++ lshw-02.17/debian/changelog @@ -1,3 +1,12 @@ +lshw (02.17-1.1ubuntu3.3) xenial; urgency=medium + + * Fix situation where lshw segfaults, when there is an external + USB 3.0 drive connected to the system. (LP: #1471983) + - d/p/fix-701-SCSI-inquiry-fails-on-IA64.patch: + use uint8_t instead of char where unsigned is needed. + + -- Dan Streetman Thu, 19 Oct 2017 10:19:02 -0400 + lshw (02.17-1.1ubuntu3.2) xenial; urgency=medium * d/p/Avoid-crash-in-scan_dmi_sysfs-when-running-as-non-ro.patch: Fix a diff -u lshw-02.17/debian/patches/series lshw-02.17/debian/patches/series --- lshw-02.17/debian/patches/series +++ lshw-02.17/debian/patches/series @@ -20,0 +21 @@ +fix-701-SCSI-inquiry-fails-on-IA64.patch only in patch2: unchanged: --- lshw-02.17.orig/debian/patches/fix-701-SCSI-inquiry-fails-on-IA64.patch +++ lshw-02.17/debian/patches/fix-701-SCSI-inquiry-fails-on-IA64.patch @@ -0,0 +1,73 @@ +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://ezix.org/src/pkg/lshw/commit/7b57987bb21d8c178c9beba1f5a574eb0af18e54 +Bug: http://www.ezix.org/project/ticket/701 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1471983 +Index: lshw-02.17/src/core/scsi.cc +=================================================================== +--- lshw-02.17.orig/src/core/scsi.cc ++++ lshw-02.17/src/core/scsi.cc +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -439,7 +440,7 @@ static u_int16_t decode_word(void *ptr) + static bool do_inquiry(int sg_fd, + hwNode & node) + { +- char rsp_buff[MX_ALLOC_LEN + 1]; ++ uint8_t rsp_buff[MX_ALLOC_LEN + 1]; + int k; + unsigned int len; + +@@ -469,11 +470,11 @@ hwNode & node) + if (rsp_buff[1] & 0x80) + node.addCapability("removable", "support is removable"); + +- node.setVendor(string(rsp_buff + 8, 8)); ++ node.setVendor(string((char *)rsp_buff + 8, 8)); + if (len > 16) +- node.setProduct(string(rsp_buff + 16, 16)); ++ node.setProduct(string((char *)rsp_buff + 16, 16)); + if (len > 32) +- node.setVersion(string(rsp_buff + 32, 4)); ++ node.setVersion(string((char *)rsp_buff + 32, 4)); + + if (ansiversion) + node.setConfig("ansiversion", tostring(ansiversion)); +@@ -481,9 +482,9 @@ hwNode & node) + memset(rsp_buff, 0, sizeof(rsp_buff)); + if (do_inq(sg_fd, 0, 1, 0x80, rsp_buff, MX_ALLOC_LEN, 0)) + { +- char _len = rsp_buff[3]; ++ uint8_t _len = rsp_buff[3]; + if (_len > 0) +- node.setSerial(hw::strip(string(rsp_buff + 4, _len))); ++ node.setSerial(hw::strip(string((char *)rsp_buff + 4, _len))); + } + + memset(rsp_buff, 0, sizeof(rsp_buff)); +@@ -494,14 +495,14 @@ hwNode & node) + unsigned long long cyl = 0; + unsigned long long sectors = 0; + unsigned long rpm = 0; +- u_int8_t *end = (u_int8_t *) rsp_buff + (u_int8_t) rsp_buff[0]; +- u_int8_t *p = NULL; ++ uint8_t *end = rsp_buff + rsp_buff[0]; ++ uint8_t *p = NULL; + + if (rsp_buff[3] == 8) + sectsize = decode_3_bytes(rsp_buff + 9); + +- p = (u_int8_t *) & rsp_buff[4]; +- p += (u_int8_t) rsp_buff[3]; ++ p = & rsp_buff[4]; ++ p += rsp_buff[3]; + while (p < end) + { + u_int8_t page = *p & 0x3F;