[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lvm2-commits
Subject:    =?utf-8?q?=5Blvm2-commits=5D?= master - coverity: ensure lock_type is not NULL
From:       Zdenek Kabelac <zkabelac () sourceware ! org>
Date:       2018-03-17 22:35:32
Message-ID: 20180317223532.1A45824B463CD () mailman01 ! phx2 ! fedoraproject ! org
[Download RAW message or body]

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f331eb1c0d060529a3b5e6517c8ac423e21796d3
Commit:        f331eb1c0d060529a3b5e6517c8ac423e21796d3
Parent:        fd6661dfcf7568d32a127e63b0d6c95c010688fb
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Sat Mar 17 14:16:09 2018 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Sat Mar 17 23:33:58 2018 +0100

coverity: ensure lock_type is not NULL

---
 tools/vgchange.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/vgchange.c b/tools/vgchange.c
index 6d739fe..7cfaab6 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -955,7 +955,7 @@ static int _vgchange_locktype(struct cmd_context *cmd, struct volume_group *vg)
 			vg->lock_type = "none";
 	}
 
-	if (!strcmp(vg->lock_type, lock_type)) {
+	if (lock_type && !strcmp(vg->lock_type, lock_type)) {
 		log_warn("New lock type %s matches the current lock type %s.",
 			 lock_type, vg->lock_type);
 		return 1;
@@ -1180,7 +1180,7 @@ int vgchange_locktype_cmd(struct cmd_context *cmd, int argc, char **argv)
 	 * just return success when they see the disable flag set.
 	 */
 	if (lockopt && !strcmp(lockopt, "force")) {
-		if (strcmp(lock_type, "none")) {
+		if (lock_type && strcmp(lock_type, "none")) {
 			log_error("Lock type can only be forced to \"none\" for recovery.");
 			return 0;
 		}
_______________________________________________
lvm2-commits mailing list -- lvm2-commits@lists.fedorahosted.org
To unsubscribe send an email to lvm2-commits-leave@lists.fedorahosted.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic