]> sourceware.org Git - lvm2.git/commitdiff
cleanup: ensuring string is not NULL
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 9 Nov 2015 15:58:24 +0000 (16:58 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 9 Nov 2015 16:04:10 +0000 (17:04 +0100)
Coverity cannot see the string cannot be NULL so make it explicit.

lib/commands/toolcontext.c

index c150991dd5d73c4411d6b7bd800cbca99abcfa04..a2f21b84406c0bbe0145320736c6630910f63836 100644 (file)
@@ -561,9 +561,9 @@ static int _process_config(struct cmd_context *cmd)
 #endif
 
        dev_ext_info_src = find_config_tree_str(cmd, devices_external_device_info_source_CFG, NULL);
-       if (!strcmp(dev_ext_info_src, "none"))
+       if (dev_ext_info_src && !strcmp(dev_ext_info_src, "none"))
                init_external_device_info_source(DEV_EXT_NONE);
-       else if (!strcmp(dev_ext_info_src, "udev"))
+       else if (dev_ext_info_src && !strcmp(dev_ext_info_src, "udev"))
                init_external_device_info_source(DEV_EXT_UDEV);
        else {
                log_error("Invalid external device info source specification.");
This page took 0.041182 seconds and 5 git commands to generate.