Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/iscsi/dist/src/lib external/bsd/iscsi: Fix -Wer...



details:   https://anonhg.NetBSD.org/src/rev/46d33fd30283
branches:  trunk
changeset: 745941:46d33fd30283
user:      fox <fox%NetBSD.org@localhost>
date:      Tue Mar 17 00:57:54 2020 +0000

description:
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@

diffstat:

 external/bsd/iscsi/dist/src/lib/initiator.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 9d4124163f9b -r 46d33fd30283 external/bsd/iscsi/dist/src/lib/initiator.c
--- a/external/bsd/iscsi/dist/src/lib/initiator.c       Tue Mar 17 00:54:03 2020 +0000
+++ b/external/bsd/iscsi/dist/src/lib/initiator.c       Tue Mar 17 00:57:54 2020 +0000
@@ -794,6 +794,7 @@
                }
        } 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 @@
                                break;
                        }
                }
-               if (i >= svp->c) {
+               if (ptr == NULL) {
                        iscsi_err(__FILE__, __LINE__,
                                "SendTargets failed - target `%s' not found\n",
                                g_target[target].iqnwanted);



Home | Main Index | Thread Index | Old Index