summaryrefslogtreecommitdiff
path: root/debian/patches/0155-use_read_file.patch
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-07-15 15:42:52 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-07-15 15:42:52 +0200
commit28c507a87ce5c5fcb63476d29690331d47ac069c (patch)
treeed9e9057c767a6ce4a6801add7d93a64a9ce084c /debian/patches/0155-use_read_file.patch
parentb65d4ecc6ca6e48ba16151e644696d24c9a1ed92 (diff)
New upstream patches
Diffstat (limited to 'debian/patches/0155-use_read_file.patch')
-rw-r--r--debian/patches/0155-use_read_file.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/debian/patches/0155-use_read_file.patch b/debian/patches/0155-use_read_file.patch
new file mode 100644
index 0000000..18b1fb3
--- /dev/null
+++ b/debian/patches/0155-use_read_file.patch
@@ -0,0 +1,43 @@
+Description: Use read_file() instead of mem_chunk()
+Origin: upstream, https://git.savannah.gnu.org/cgit/dmidecode.git/commit/?id=c76ddda0ba0aa99a55945e3290095c2ec493c892
+Forwarded: not-needed
+Last-Update: 2023-07-15
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: trunk/dmidecode.c
+===================================================================
+--- trunk.orig/dmidecode.c
++++ trunk/dmidecode.c
+@@ -6025,15 +6025,23 @@ int main(int argc, char * const argv[])
+ pr_comment("dmidecode %s", VERSION);
+
+ /* Read from dump if so instructed */
++ size = 0x20;
+ if (opt.flags & FLAG_FROM_DUMP)
+ {
+ if (!(opt.flags & FLAG_QUIET))
+ pr_info("Reading SMBIOS/DMI data from file %s.",
+ opt.dumpfile);
+- if ((buf = mem_chunk(0, 0x20, opt.dumpfile)) == NULL)
++ if ((buf = read_file(0, &size, opt.dumpfile)) == NULL)
+ {
+ ret = 1;
+ goto exit_free;
++ }
++
++ /* Truncated entry point can't be processed */
++ if (size < 0x20)
++ {
++ ret = 1;
++ goto done;
+ }
+
+ if (memcmp(buf, "_SM3_", 5) == 0)
+@@ -6059,7 +6067,6 @@ int main(int argc, char * const argv[])
+ * contain one of several types of entry points, so read enough for
+ * the largest one, then determine what type it contains.
+ */
+- size = 0x20;
+ if (!(opt.flags & FLAG_NO_SYSFS)
+ && (buf = read_file(0, &size, SYS_ENTRY_FILE)) != NULL)
+ {