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/71c143c05b71
branches:  trunk
changeset: 970236:71c143c05b71
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 e6587361ca8f -r 71c143c05b71 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