Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/ntp/dist Adjustments to our patches requested b...



details:   https://anonhg.NetBSD.org/src/rev/23041c562200
branches:  trunk
changeset: 933585:23041c562200
user:      christos <christos%NetBSD.org@localhost>
date:      Wed May 27 23:52:19 2020 +0000

description:
Adjustments to our patches requested by upstream

diffstat:

 external/bsd/ntp/dist/ntpd/ntp_config.c          |  4 ++--
 external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c |  4 +++-
 external/bsd/ntp/dist/ntpq/ntpq.c                |  4 ++--
 external/bsd/ntp/dist/util/ntp-keygen.c          |  4 ++--
 4 files changed, 9 insertions(+), 7 deletions(-)

diffs (79 lines):

diff -r 335f347738e0 -r 23041c562200 external/bsd/ntp/dist/ntpd/ntp_config.c
--- a/external/bsd/ntp/dist/ntpd/ntp_config.c   Wed May 27 22:27:58 2020 +0000
+++ b/external/bsd/ntp/dist/ntpd/ntp_config.c   Wed May 27 23:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntp_config.c,v 1.22 2020/05/25 20:47:25 christos Exp $ */
+/*     $NetBSD: ntp_config.c,v 1.23 2020/05/27 23:52:19 christos Exp $ */
 
 /* ntp_config.c
  *
@@ -3892,7 +3892,7 @@
 
                        case T_Refid:
                                clock_stat.haveflags |= CLK_HAVEVAL2;
-                               /* strncpy() does exactly what we want here: */
+                               /* avoid using strncpy because gcc warns */
                                len = strlen(curr_opt->value.s);
                                if (len > sizeof(clock_stat.fudgeval2))
                                        len = sizeof(clock_stat.fudgeval2);
diff -r 335f347738e0 -r 23041c562200 external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c
--- a/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c  Wed May 27 22:27:58 2020 +0000
+++ b/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c  Wed May 27 23:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refclock_neoclock4x.c,v 1.11 2020/05/25 20:47:25 christos Exp $        */
+/*     $NetBSD: refclock_neoclock4x.c,v 1.12 2020/05/27 23:52:19 christos Exp $        */
 
 /*
  *
@@ -727,6 +727,7 @@
   if(NULL != out)
     {
       char *tt;
+      /* the 199 here is almost 2x the max string */
       char tmpbuf[199];
 
       out->kv_list = (struct ctl_var *)0;
@@ -767,6 +768,7 @@
         snprintf(tt, 39, "dststatus=\"winter\"");
       else
         snprintf(tt, 39, "dststatus=\"unknown\"");
+      /* the 99 below is greater than 80 the max string */
       tt = add_var(&out->kv_list, 80, RO|DEF);
       snprintf(tt, 99, "firmware=\"%s\"", up->firmware);
       tt = add_var(&out->kv_list, 40, RO|DEF);
diff -r 335f347738e0 -r 23041c562200 external/bsd/ntp/dist/ntpq/ntpq.c
--- a/external/bsd/ntp/dist/ntpq/ntpq.c Wed May 27 22:27:58 2020 +0000
+++ b/external/bsd/ntp/dist/ntpq/ntpq.c Wed May 27 23:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntpq.c,v 1.21 2020/05/25 20:47:26 christos Exp $       */
+/*     $NetBSD: ntpq.c,v 1.22 2020/05/27 23:52:19 christos Exp $       */
 
 /*
  * ntpq - query an NTP server using mode 6 commands
@@ -3738,7 +3738,7 @@
                case SN:
                        if (!value)
                                output_raw = '?';
-                       else if (isdigit((unsigned char)*value)) {      /* number without sign */
+                       else if (isdigit(*(const unsigned char *)value)) {      /* number without sign */
                                bv[0] = '+';
                                atoascii (value, MAXVALLEN, bv+1, sizeof(bv)-1);
                                output(fp, name, bv);
diff -r 335f347738e0 -r 23041c562200 external/bsd/ntp/dist/util/ntp-keygen.c
--- a/external/bsd/ntp/dist/util/ntp-keygen.c   Wed May 27 22:27:58 2020 +0000
+++ b/external/bsd/ntp/dist/util/ntp-keygen.c   Wed May 27 23:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntp-keygen.c,v 1.13 2020/05/25 20:47:37 christos Exp $ */
+/*     $NetBSD: ntp-keygen.c,v 1.14 2020/05/27 23:52:20 christos Exp $ */
 
 /*
  * Program to generate cryptographic keys for ntp clients and servers
@@ -281,7 +281,7 @@
 
        REQUIRE(bufsiz > 0);
 
-       len = readlink(fname, result, bufsiz);
+       len = readlink(fname, result, sizeof(result));
        if (len < 0) {
                fname[0] = '\0';
                return;



Home | Main Index | Thread Index | Old Index