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,10 @@ +lshw (02.16-2ubuntu1.4) trusty; urgency=medium + + * use local var and use uint8_t instead of char where unsigned + is needed (LP: #1471983) + + -- Dan Streetman Thu, 19 Oct 2017 10:19:02 -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 @@ -19,0 +20,2 @@ +presumably-fix-653.patch +fix-701-SCSI-inquiry-fails-on-IA64.patch only in patch2: unchanged: --- lshw-02.16.orig/debian/patches/fix-701-SCSI-inquiry-fails-on-IA64.patch +++ lshw-02.16/debian/patches/fix-701-SCSI-inquiry-fails-on-IA64.patch @@ -0,0 +1,83 @@ +From: Lyonel Vincent +Subject: [PATCH] fix #701 (SCSI inquiry fails on IA64) +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lshw/+bug/1471983 +Description: USB HDD makes lshw segfault. + In some cases, lshw segfault, when there is a external USB drive connected to the system. +Origin: upstream, https://ezix.org/src/pkg/lshw/commit/7b57987bb21d8c178c9beba1f5a574eb0af18e54 + + +git-svn-id: http://ezix.org/source/packages/lshw/development@2585 811e2811-9fd9-0310-a116-b6e8ac943c8b +--- + src/core/scsi.cc | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +diff --git a/src/core/scsi.cc b/src/core/scsi.cc +index 4aaec81..e0399ab 100644 +--- a/src/core/scsi.cc ++++ b/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; +-- +2.14.1 + only in patch2: unchanged: --- lshw-02.16.orig/debian/patches/presumably-fix-653.patch +++ lshw-02.16/debian/patches/presumably-fix-653.patch @@ -0,0 +1,33 @@ +From: Lyonel Vincent +Subject: [PATCH] (presumably) fix #653 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lshw/+bug/1471983 +Description: USB HDD makes lshw segfault. + In some cases, lshw segfault, when there is a external USB drive connected to the system. +Origin: upstream, https://ezix.org/src/pkg/lshw/commit/d048d300b5daeb44887a7fc06ddeb120119cac8a + + +git-svn-id: http://ezix.org/source/packages/lshw/development@2535 811e2811-9fd9-0310-a116-b6e8ac943c8b +--- + src/core/scsi.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/core/scsi.cc b/src/core/scsi.cc +index ed059cb..d85fcc8 100644 +--- a/src/core/scsi.cc ++++ b/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)); +-- +2.14.1 +