]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
driver40-ja.html:
authorTakao Abe <abe@ntp.org>
Fri, 1 May 2015 13:27:32 +0000 (13:27 +0000)
committerTakao Abe <abe@ntp.org>
Fri, 1 May 2015 13:27:32 +0000 (13:27 +0000)
  [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

ChangeLog
html/drivers/driver40-ja.html
ntpd/refclock_jjy.c

index 7756b91557278f3d62c370fe13c062a80cd2641b..0a1890a1345ca171ac333879027afaf3f66375d2 100644 (file)
--- 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.
index 5f4f8939a8b48abcbced5b24933ae11f552065a8..45c656d1fae83b5be2c9f2d3db6d46b43c4b8f1b 100644 (file)
@@ -15,7 +15,7 @@
        <body>
                <h3>JJY Receivers</h3>
 <p>Last update:
-  <!-- #BeginDate format:En2m -->30-Apr-2015  05:53<!-- #EndDate -->
+  <!-- #BeginDate format:En2m -->11-Apr-2015  00:00<!-- #EndDate -->
   UTC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="driver40.html">ENGLISH(英語)</a> &nbsp; <a href="driver40-ja.html">JAPANESE(日本語)</a></p>
                <hr>
                <h4>Synopsis</h4>
                                                        <dd>
                                                                <p>Time1 は、受信機からの時刻に加算する調整時間を、固定小数点形式の秒で設定します。<br>
                                                                mode 100 の場合は、time1 で調整する時間を設定したほうが良いでしょう。<br>
-                                                               mode 101 から 108 の場合は、このドライバーが計測したループバックの遅延時間の一定の割合を同期時刻に加算しますので、time1 は設定しないほうが良いでしょう。</p>
+                                                               mode 101 から 180 の場合は、このドライバーが計測したループバックの遅延時間の一定の割合を同期時刻に加算しますので、time1 は設定しないほうが良いでしょう。</p>
                                                                <div style="text-align:left;">Flag1 は、タッチ・トーンかダイヤル・パルスかを指定します。</div>
                                                                <table border="1" summary="fudge flag1">
                                                                        <tr><td>0 (Default)</td><td>タッチ・トーン</td><td>ATDWTnn...nn</td></tr>
index 420f8bb8c7174450d50748610cca7e67f595da17..c10bf64b10117defcf0df8e3cea248c8621cbeb9 100644 (file)
@@ -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 ) ;