From 9f85c069af193d35b1c45c7f91c39f8fb6e5bfff Mon Sep 17 00:00:00 2001 From: Rmys Date: Sat, 1 Feb 2020 00:02:54 +0300 Subject: [PATCH] libsmbios --- ...re-places-with-loop-iterators-with-b.patch | 51 +++++++++++++++++++ hardware/misc/libsmbios/pspec.xml | 12 ++++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 hardware/misc/libsmbios/files/0001-libsmbios-fix-more-places-with-loop-iterators-with-b.patch diff --git a/hardware/misc/libsmbios/files/0001-libsmbios-fix-more-places-with-loop-iterators-with-b.patch b/hardware/misc/libsmbios/files/0001-libsmbios-fix-more-places-with-loop-iterators-with-b.patch new file mode 100644 index 0000000000..604318aaa5 --- /dev/null +++ b/hardware/misc/libsmbios/files/0001-libsmbios-fix-more-places-with-loop-iterators-with-b.patch @@ -0,0 +1,51 @@ +From 22728f16eb611411258146045030292e1170bfef Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 14 Feb 2018 16:15:28 -0500 +Subject: [PATCH] libsmbios: fix more places with loop iterators with bad types + +In these cases we get: + +../src/libsmbios_c/smbios/smbios_obj.c: In function 'smbios_verify_smbios': +../src/libsmbios_c/smbios/smbios_obj.c:415:31: error: comparison of integer expressions of different signedness: 'unsigned int' and 'long int' [-Werror=sign-compare] + for(unsigned int i = 0; i < length ; ++i ) + ^ +../src/libsmbios_c/smbios/smbios_obj.c: In function 'smbios_verify_smbios3': +../src/libsmbios_c/smbios/smbios_obj.c:436:31: error: comparison of integer expressions of different signedness: 'unsigned int' and 'long int' [-Werror=sign-compare] + for(unsigned int i = 0; i < length ; ++i ) + ^ + +I really don't understand why gcc will complain about it being signed vs +unsigned, but not about the fact that the int can obviously overflow +before the condition being checked against length, a larger type, is +satisfied. + +Signed-off-by: Peter Jones +--- + src/libsmbios_c/smbios/smbios_obj.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/libsmbios_c/smbios/smbios_obj.c b/src/libsmbios_c/smbios/smbios_obj.c +index a6f2e1e3525..c932ba59535 100644 +--- a/src/libsmbios_c/smbios/smbios_obj.c ++++ b/src/libsmbios_c/smbios/smbios_obj.c +@@ -412,7 +412,7 @@ bool __hidden smbios_verify_smbios(const char *buf, long length, long *dmi_lengt + bool retval = true; + + u8 checksum = 0; +- for(unsigned int i = 0; i < length ; ++i ) ++ for(long i = 0; i < length ; ++i ) + checksum = (checksum + buf[i]) & 0xFF; + + fnprintf("SMBIOS TEP csum %d.\n", (int)checksum); +@@ -433,7 +433,7 @@ bool __hidden smbios_verify_smbios3(const char *buf, long length, long *dmi_leng + { + struct smbios_table_entry_point_64 *ep; + u8 checksum = 0; +- for(unsigned int i = 0; i < length ; ++i ) ++ for(long i = 0; i < length ; ++i ) + checksum = (checksum + buf[i]) & 0xFF; + + fnprintf("SMBIOS TEP csum %d.\n", (int)checksum); +-- +2.14.3 + diff --git a/hardware/misc/libsmbios/pspec.xml b/hardware/misc/libsmbios/pspec.xml index a4b15aec2a..c6ca53508f 100644 --- a/hardware/misc/libsmbios/pspec.xml +++ b/hardware/misc/libsmbios/pspec.xml @@ -19,7 +19,10 @@ libxml2-devel chrpath doxygen - + + + 0001-libsmbios-fix-more-places-with-loop-iterators-with-b.patch + @@ -54,6 +57,13 @@ + + 2020-01-31 + 2.4.2 + Rebuild New T. + Mustafa Cinasal + muscnsl@gmail.com + 2018-09-01 2.4.2