summaryrefslogtreecommitdiff
path: root/sys-apps/util-linux/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-08-01 22:03:23 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-08-01 22:03:23 +0100
commit590b9b7b03bf4651e099949e318755af7cfa81b8 (patch)
tree54c184b7d26c25f1922bfeaf19a1dd45a2e3b1eb /sys-apps/util-linux/files
parentf4fc10428424904caf2035cffc442195cb088b2c (diff)
gentoo resync : 01.08.2021
Diffstat (limited to 'sys-apps/util-linux/files')
-rw-r--r--sys-apps/util-linux/files/util-linux-2.37.1-lscpu_nullptr.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/sys-apps/util-linux/files/util-linux-2.37.1-lscpu_nullptr.patch b/sys-apps/util-linux/files/util-linux-2.37.1-lscpu_nullptr.patch
new file mode 100644
index 000000000000..bfb528cf1f15
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.37.1-lscpu_nullptr.patch
@@ -0,0 +1,26 @@
+If you call a function which can return a null pointer you probably want
+to check the return value before attempting to dereference it. </sarcasm>
+
+--- a/sys-utils/lscpu.c
++++ b/sys-utils/lscpu.c
+@@ -966,7 +966,7 @@
+ *(p - 2) = '\0';
+ add_summary_s(tb, sec, _("CPU op-mode(s):"), buf);
+ }
+- if (ct->addrsz)
++ if (ct && ct->addrsz)
+ add_summary_s(tb, sec, _("Address sizes:"), ct->addrsz);
+ #if !defined(WORDS_BIGENDIAN)
+ add_summary_s(tb, sec, _("Byte Order:"), "Little Endian");
+@@ -1008,9 +1008,9 @@
+ sec = NULL;
+
+ /* Section: cpu type description */
+- if (ct->vendor)
++ if (ct && ct->vendor)
+ sec = add_summary_s(tb, NULL, _("Vendor ID:"), ct->vendor);
+- if (ct->bios_vendor)
++ if (ct && ct->bios_vendor)
+ add_summary_s(tb, sec, _("BIOS Vendor ID:"), ct->bios_vendor);
+
+ for (i = 0; i < cxt->ncputypes; i++)