Blame SOURCES/0024-Coverity-still-doesn-t-believe-in-error-codes.patch

36520b
From c2223eb4638c6d8562626917651a11b8aa1e8f9e Mon Sep 17 00:00:00 2001
36520b
From: Peter Jones <pjones@redhat.com>
36520b
Date: Thu, 21 Jun 2018 16:18:32 -0400
36520b
Subject: [PATCH 24/39] Coverity still doesn't believe in error codes...
36520b
36520b
So also test fbuf here.
36520b
36520b
Signed-off-by: Peter Jones <pjones@redhat.com>
36520b
---
36520b
 src/linux-acpi.c | 2 +-
36520b
 1 file changed, 1 insertion(+), 1 deletion(-)
36520b
36520b
diff --git a/src/linux-acpi.c b/src/linux-acpi.c
36520b
index 88f0084a37e..346eba09041 100644
36520b
--- a/src/linux-acpi.c
36520b
+++ b/src/linux-acpi.c
36520b
@@ -49,7 +49,7 @@ parse_acpi_hid_uid(struct device *dev, const char *fmt, ...)
36520b
                 return -1;
36520b
 
36520b
         rc = read_sysfs_file(&fbuf, "%s/firmware_node/path", path);
36520b
-        if (rc > 0) {
36520b
+        if (rc > 0 && fbuf) {
36520b
                 size_t l = strlen(fbuf);
36520b
                 if (l > 1) {
36520b
                         fbuf[l-1] = 0;
36520b
-- 
36520b
2.17.1
36520b