Module Name:    src
Committed By:   fox
Date:           Tue Mar 17 00:57:55 UTC 2020

Modified Files:
        src/external/bsd/iscsi/dist/src/lib: initiator.c

Log Message:
external/bsd/iscsi: Fix -Werror=maybe-uninitialized error in initiator.c.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Submitted by: mlelstv@
Reviewed by: kamil@


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/iscsi/dist/src/lib/initiator.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/initiator.c
diff -u src/external/bsd/iscsi/dist/src/lib/initiator.c:1.9 src/external/bsd/iscsi/dist/src/lib/initiator.c:1.10
--- src/external/bsd/iscsi/dist/src/lib/initiator.c:1.9	Fri Nov  1 07:53:34 2013
+++ src/external/bsd/iscsi/dist/src/lib/initiator.c	Tue Mar 17 00:57:54 2020
@@ -794,6 +794,7 @@ discovery_phase(int target, strv_t *svp)
 		}
 	} else {
 		/* the user has asked for a specific target - find it */
+		ptr = NULL;
 		for (i = 0 ; i < svp->c ; i += 2) {
 			if (strcmp(g_target[target].iqnwanted,
 					svp->v[i]) == 0) {
@@ -803,7 +804,7 @@ discovery_phase(int target, strv_t *svp)
 				break;
 			}
 		}
-		if (i >= svp->c) {
+		if (ptr == NULL) {
 			iscsi_err(__FILE__, __LINE__,
 				"SendTargets failed - target `%s' not found\n",
 				g_target[target].iqnwanted);

Reply via email to