From: Juergen Perlinger Date: Wed, 11 Apr 2018 17:26:04 +0000 (+0200) Subject: [Bug 3484] ntpq response from ntpd is incorrect when REFID is null X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9451b3e976da33f4de2a124884e3ea40feca5bba;p=thirdparty%2Fntp.git [Bug 3484] ntpq response from ntpd is incorrect when REFID is null bk: 5ace452cxIn7bxVukTL2U2qMEZEFIA --- diff --git a/ChangeLog b/ChangeLog index 45a670849..6558787a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * [Bug 3485] Undefined sockaddr used in error messages in ntp_config.c - applied patch by Gerry Garvey +* [Bug 3484] ntpq response from ntpd is incorrect when REFID is null * [Bug 3482] Fixes for compilation warnings (ntp_io.c & ntpq-subs.c) - applied patch by Gerry Garvey (with mods) * [Bug 3480] Refclock sample filter not cleared on clock STEP diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c index 797e850c2..8f311334c 100644 --- a/ntpd/ntp_control.c +++ b/ntpd/ntp_control.c @@ -1633,14 +1633,14 @@ ctl_putunqstr( args[0].buf = tag; args[0].len = strlen(tag); + args[1].buf = "="; + args[1].len = 1; if (data && len) { - args[1].buf = "="; - args[1].len = 1; - args[2].buf = data; - args[2].len = len; - ctl_putdata_ex(args, 3, FALSE); + args[2].buf = data; + args[2].len = len; + ctl_putdata_ex(args, 3, FALSE); } else { - ctl_putdata_ex(args, 1, FALSE); + ctl_putdata_ex(args, 2, FALSE); } }