Blame SOURCES/0044-fix-potential-crash.patch

121cca
From ff634c9a714fe25d3394c9713929c80888c0c01d Mon Sep 17 00:00:00 2001
121cca
From: Lyonel Vincent <lyonel@ezix.org>
121cca
Date: Sun, 10 Jan 2021 01:03:50 +0100
121cca
Subject: [PATCH 44/65] fix potential crash
121cca
121cca
cf. Github PR#47
121cca
---
121cca
 src/core/dmi.cc | 2 ++
121cca
 1 file changed, 2 insertions(+)
121cca
121cca
diff --git a/src/core/dmi.cc b/src/core/dmi.cc
121cca
index d33d487..fe6ad39 100644
121cca
--- a/src/core/dmi.cc
121cca
+++ b/src/core/dmi.cc
121cca
@@ -1924,6 +1924,8 @@ static bool scan_dmi_sysfs(hwNode & n)
121cca
 
121cca
   ifstream ep_stream(SYSFSDMI "/smbios_entry_point",
121cca
       ifstream::in | ifstream::binary | ifstream::ate);
121cca
+  if (!ep_stream)
121cca
+    return false;
121cca
   ifstream::pos_type ep_len = ep_stream.tellg();
121cca
   vector < u8 > ep_buf(ep_len);
121cca
   ep_stream.seekg(0, ifstream::beg);
121cca
-- 
121cca
2.33.1
121cca