Source-Changes-HG archive

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

[src/trunk]: src/dist/ntp/ntpd Don't attempt to use an uninitialized variable...



details:   https://anonhg.NetBSD.org/src/rev/20eae37e27ff
branches:  trunk
changeset: 581671:20eae37e27ff
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Jun 03 16:13:33 2005 +0000

description:
Don't attempt to use an uninitialized variable when there's no interfaces.
Detected with gcc -Wuninitialized.

diffstat:

 dist/ntp/ntpd/ntp_io.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r 2e40e483013e -r 20eae37e27ff dist/ntp/ntpd/ntp_io.c
--- a/dist/ntp/ntpd/ntp_io.c    Fri Jun 03 16:12:07 2005 +0000
+++ b/dist/ntp/ntpd/ntp_io.c    Fri Jun 03 16:13:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntp_io.c,v 1.11 2004/10/05 03:34:38 christos Exp $     */
+/*     $NetBSD: ntp_io.c,v 1.12 2005/06/03 16:13:33 lukem Exp $        */
 
 /*
  * ntp_io.c - input/output routines for ntpd.  The socket-opening code
@@ -1386,6 +1386,7 @@
 #endif
        if (inter == NULL) {
                errno = EAFNOSUPPORT;
+               slot = -1;
                goto nointerface;
        }
 



Home | Main Index | Thread Index | Old Index