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

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