From: Takao Abe Date: Fri, 1 May 2015 13:27:32 +0000 (+0000) Subject: driver40-ja.html: X-Git-Tag: NTP_4_3_26~2^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04dab5903139648c82094cf2e2edf677d0c76522;p=thirdparty%2Fntp.git driver40-ja.html: [BUG 2806] Correcting typo of the driver40-ja.html ChangeLog: [BUG 2806] CID 1296235: refclock_jjy.c and correcting typo of driver40-ja.html refclock_jjy.c: [BUG 2806] CID 1296235: Fix refclock_jjy.c and some changes to avoid claims by the check tool bk: 55437f44kA4RjsB78F6emJHatpyTAw --- diff --git a/ChangeLog b/ChangeLog index 7756b9155..0a1890a13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ --- +* CID 1296235: Fix refclock_jjy.c and correcting type of the driver40-ja.html * CID 1269537: Clean up a line of dead code in getShmTime(). * CID 1295478: Quiet a pedantic potential error from the fix for Bug 2776. * [Bug 2590] autogen-5.18.5. diff --git a/html/drivers/driver40-ja.html b/html/drivers/driver40-ja.html index 5f4f8939a..45c656d1f 100644 --- a/html/drivers/driver40-ja.html +++ b/html/drivers/driver40-ja.html @@ -15,7 +15,7 @@

JJY Receivers

Last update: - 30-Apr-2015 05:53 + 11-Apr-2015 00:00 UTC          ENGLISH(英語)   JAPANESE(日本語)


Synopsis

@@ -306,7 +306,7 @@

Time1 は、受信機からの時刻に加算する調整時間を、固定小数点形式の秒で設定します。
mode 100 の場合は、time1 で調整する時間を設定したほうが良いでしょう。
- mode 101 から 108 の場合は、このドライバーが計測したループバックの遅延時間の一定の割合を同期時刻に加算しますので、time1 は設定しないほうが良いでしょう。

+ mode 101 から 180 の場合は、このドライバーが計測したループバックの遅延時間の一定の割合を同期時刻に加算しますので、time1 は設定しないほうが良いでしょう。

Flag1 は、タッチ・トーンかダイヤル・パルスかを指定します。
diff --git a/ntpd/refclock_jjy.c b/ntpd/refclock_jjy.c index 420f8bb8c..c10bf64b1 100644 --- a/ntpd/refclock_jjy.c +++ b/ntpd/refclock_jjy.c @@ -587,7 +587,10 @@ jjy_receive ( struct recvbuf *rbufp ) */ if ( up->linediscipline == LDISC_RAW ) { - pp->lencode = refclock_gtraw ( rbufp, pp->a_lastcode, BMAX, &tRecvTimestamp ) ; + pp->lencode = refclock_gtraw ( rbufp, pp->a_lastcode, BMAX-1, &tRecvTimestamp ) ; + /* 3rd argument can be BMAX, but the coverity scan tool claim "Memory - corruptions (OVERRUN)" */ + /* "a_lastcode" is defined as "char a_lastcode[BMAX]" in the ntp_refclock.h */ + /* To avoid its claim, pass the value BMAX-1. */ /* * Append received charaters to temporary buffer @@ -2461,7 +2464,7 @@ jjy_start_telephone ( int unit, struct peer *peer, struct jjyunit *up ) iNumberOfDigitsOfPhoneNumber = iCommaCount = iCommaPosition = iFirstThreeDigitsCount = 0 ; for ( i = 0 ; i < strlen( sys_phone[0] ) ; i ++ ) { if ( isdigit( *(sys_phone[0]+i) ) ) { - if ( iFirstThreeDigitsCount < MAX_LOOPBACK ) { + if ( iFirstThreeDigitsCount < sizeof(sFirstThreeDigits)-1 ) { sFirstThreeDigits[iFirstThreeDigitsCount++] = *(sys_phone[0]+i) ; } iNumberOfDigitsOfPhoneNumber ++ ; @@ -2836,6 +2839,13 @@ teljjy_getDelay ( struct peer *peer, struct jjyunit *up ) iAverCount ++ ; } + if ( iAverCount == 0 ) { + /* This is never happened. */ + /* Previous for-if-for blocks assure iAverCount > 0. */ + /* This code avoids a claim by the coverity scan tool. */ + return -1 ; + } + /* mode 101 = 1%, mode 150 = 50%, mode 180 = 80% */ iPercent = ( peer->ttl - 100 ) ;
0 (Default)タッチ・トーンATDWTnn...nn