From: Juergen Perlinger Date: Sat, 10 Aug 2019 07:03:06 +0000 (+0200) Subject: [Bug 3604] Wrong param byte order passing into record_raw_stats() in ntp_io.c X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0df6db9dcf6699903432dc39df1289089326dcf5;p=thirdparty%2Fntp.git [Bug 3604] Wrong param byte order passing into record_raw_stats() in ntp_io.c bk: 5d4e6c2ap24QDpKCCTsCiFR4nS9K0Q --- diff --git a/ChangeLog b/ChangeLog index 9ff845c81..7a0e9308d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ --- +* [Bug 3604] Wrong param byte order passing into record_raw_stats() in + ntp_io.c + - fixed byte and paramter order as suggested by wei6410@sina.com +--- (4.2.8p13) 2019/03/07 Released by Harlan Stenn * [Sec 3565] Crafted null dereference attack in authenticated diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index b89b996e9..3bc67904b 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -3134,7 +3134,8 @@ sendpkt( int rc; u_char cttl; l_fp fp_zero = { { 0 }, 0 }; - + l_fp org, rec, xmt; + ismcast = IS_MCAST(dest); if (!ismcast) src = ep; @@ -3219,11 +3220,14 @@ sendpkt( } while (ismcast && src != NULL); /* HMS: pkt->rootdisp is usually random here */ + NTOHL_FP(&pkt->org, &org); + NTOHL_FP(&pkt->rec, &rec); + NTOHL_FP(&pkt->xmt, &xmt); record_raw_stats(src ? &src->sin : NULL, dest, - &pkt->org, &pkt->rec, &pkt->xmt, &fp_zero, - PKT_MODE(pkt->li_vn_mode), - PKT_VERSION(pkt->li_vn_mode), + &org, &rec, &xmt, &fp_zero, PKT_LEAP(pkt->li_vn_mode), + PKT_VERSION(pkt->li_vn_mode), + PKT_MODE(pkt->li_vn_mode), pkt->stratum, pkt->ppoll, pkt->precision, pkt->rootdelay, pkt->rootdisp, pkt->refid,