]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: check strchr() result [coverity scan]
authorKarel Zak <kzak@redhat.com>
Tue, 1 Oct 2013 15:29:51 +0000 (17:29 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 1 Oct 2013 15:29:51 +0000 (17:29 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu-dmi.c

index 852817df1632382d74e0df2159e09821ac4dded1..4bfc9de59f7f89b6ca332e1feff3c6bcc1b8959a 100644 (file)
@@ -213,6 +213,8 @@ static int address_from_efi(size_t *address)
        ret = EFI_NO_SMBIOS;
        while ((fgets(linebuf, sizeof(linebuf) - 1, tab)) != NULL) {
                char *addrp = strchr(linebuf, '=');
+               if (!addrp)
+                       continue;
                *(addrp++) = '\0';
                if (strcmp(linebuf, "SMBIOS") == 0) {
                        *address = strtoul(addrp, NULL, 0);