OSDN Git Service

Coverity still doesn't believe in error codes...
authorPeter Jones <pjones@redhat.com>
Thu, 21 Jun 2018 20:18:32 +0000 (16:18 -0400)
committerPeter Jones <pjones@redhat.com>
Thu, 21 Jun 2018 20:18:32 +0000 (16:18 -0400)
So also test fbuf here.

Signed-off-by: Peter Jones <pjones@redhat.com>
src/linux-acpi.c

index 88f0084..346eba0 100644 (file)
@@ -49,7 +49,7 @@ parse_acpi_hid_uid(struct device *dev, const char *fmt, ...)
                 return -1;
 
         rc = read_sysfs_file(&fbuf, "%s/firmware_node/path", path);
-        if (rc > 0) {
+        if (rc > 0 && fbuf) {
                 size_t l = strlen(fbuf);
                 if (l > 1) {
                         fbuf[l-1] = 0;