[Ttssh2-commit] [6044] セキュアプログラミングについて英訳した。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2015年 10月 9日 (金) 00:29:56 JST


Revision: 6044
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6044
Author:   yutakapon
Date:     2015-10-09 00:29:56 +0900 (Fri, 09 Oct 2015)
Log Message:
-----------
セキュアプログラミングについて英訳した。

Modified Paths:
--------------
    trunk/doc/en/html/reference/sourcecode.html

-------------- next part --------------
Modified: trunk/doc/en/html/reference/sourcecode.html
===================================================================
--- trunk/doc/en/html/reference/sourcecode.html	2015-10-04 15:02:33 UTC (rev 6043)
+++ trunk/doc/en/html/reference/sourcecode.html	2015-10-08 15:29:56 UTC (rev 6044)
@@ -20,7 +20,8 @@
   <li><a href="#library">Library Composition</a></li>
   <li><a href="#plugin">Supporting Plug-in</a></li>
   <li><a href="#configuration">Read and Write Configuration File</a></li>
-<!--  <li><a href="#secure">セキュアプログラミング</a></li>
+  <li><a href="#secure">Secure Programming</a></li>
+<!--
   <li><a href="#compatibility">古いバージョンのWindowsとの互換性維持</a></li>
   <li><a href="#debug">デバッグ手法</a></li>
   <li><a href="#thread">マルチスレッド</a></li>
@@ -29,7 +30,8 @@
   <li><a href="#macro">マクロ言語の設計と実装</a></li>
   <li><a href="#caret">キャレット制御</a></li>
   <li><a href="#serial">シリアルポート</a></li>
-  <li><a href="#xyzmodem">バイナリ転送プロトコル</a></li>-->
+  <li><a href="#xyzmodem">バイナリ転送プロトコル</a></li>
+-->
 </ol>
 
 <hr width=80% align=center>
@@ -295,27 +297,26 @@
 <hr>
 
 
-    <!--
 
-<h2><a name="secure">セキュアプログラミング</a></h2>
+<h2><a name="secure">Secure Programming</a></h2>
 
-<h3>文字列操作</h3>
-  WindowsのデフォルトアカウントはAdministrator権限を保持するために(ただし、Windows Vistaには当てはまらない)、アプリケーションにバッファオーバーフローの不具合があると、管理者権限を第三者に奪取されてしまう危険性があります。<br>
-  従来、C言語の文字列処理は開発者のミスにより、バッファオーバーフローが発生しやすいという状況にありました。そこで、MicrosoftはVisual Studio 2005から文字列処理関数のセキュリティ強化バージョンを提供するようになりました。<br>
+<h3>String Operation</h3>
+    A default account of Microsoft Windows has the Administrator privilege except the Windows Vista. When an application has a bug regarding the buffer overflow, the third party will illegally obtain the Administrator privilege. <br>
+    Traditionally, the string operation of C language will happen the buffer overflow problem. So, Microsoft devlops the enhanced string operation from Visual Studio 2005. <br>
   <br>
 
 <ul>
-  <li><a href="http://msdn2.microsoft.com/ja-jp/library/8ef0s5kh(VS.80).aspx">CRT のセキュリティ強化(MSDNライブラリ)</a></li>
+  <li><a href="https://msdn.microsoft.com/en-us/library/8ef0s5kh(v=vs.80).aspx">Security Enhancements in the CRT(MSDN Library)</a></li>
 </ul>
 <br>
-
-  Tera Termではセキュリティ強化を図るため、文字列操作のほとんどをセキュリティ強化バージョンに置き換えています。以下に代替関数を示します。<br>
+    
+    Tera Term has replaced every string operation to enhanced version for security problem. Some alternative functions are below shown. <br>
   <br>
 
 <table border=1 align=center>
 <tr>
-  <th>旧</th>
-  <th>新</th>
+  <th>Old</th>
+  <th>New</th>
 </tr>
 
 <tr>
@@ -335,20 +336,21 @@
 </table>
   <br>
   
-  デフォルトのロケールが適用されると、期待する動作とならないケースにおいては、_snprintf_s_l()を使用しています。<br>
-  いずれの関数においても、_s("secure")という接尾辞が付くため、見た目に区別が付きやすくなっています。当然のことながら、これらの関数はANSI C非互換です。<br>
+    These functions cat not work well when the default locale is applied, Tera Term uses the _snprintf_s_l() function instead. <br>
+    Every function name has _s("secure") postfix, the function is visually recognised. Rightly, these functions are not compatible with the ANSI C specification. <br>
   <br>
-  なお、これらの関数を利用する際、Count引数(格納する最大文字数)には"_TRUNCATE"マクロを指定しており、バッファオーバーフローが発生する場合は、強制的にバッファの切り詰めを行っています。
+    Also, the Count argument(maximum number of chars to store) is specified to the "_TRUNCATE" macro. When the buffer overflow happens, the copied buffer forcibly truncates.
 <p>
+    
+    Example of using the strncpy_s() function is below shown. The second argument(numberOfElements) is specified with the buffer size <b>including the terminating null(\0)</b>.
+    The writting buffer has only three bytes, five bytes data specified by the third argument(strSource) truncates to two bytes. As a result, the buf[] stores the "he\0" string.
 
-  以下に、strncpy_s()の使用例を示します。strncpy_s()の第2引数(numberOfElements)には、<b>ナル文字(\0)も含めた</b>バッファサイズを指定します。書き込み先のバッファは3バイトしかないので、第3引数(strSource)で指定した5バイトのデータは、2バイトに切り詰められ、buf[]には"he\0"が格納されます。
-
 <pre class=code>
 char buf[3];
 strncpy_s(buf, sizeof(buf), "hello", _TRUNCATE);
 </pre>
 
-  次に、strncat_s()の使用例を示します。当該関数は、すでに存在する文字列に、さらに文字列を連結するものであるため、第1引数(strDest)は<b>かならずnull-terminateしている</b>必要性があります。strncpy_s()の第2引数(numberOfElements)には、ナル文字(\0)も含めたバッファサイズを指定します。以下の例では、最初の関数を実行すると、5バイト(4文字+ナル文字)が格納されます。2つめの関数を実行する際、残り2バイトしかないので、2文字だけがコピーされ、最終的に"TeraTe"(4文字+2文字+ナル文字)となります。
+    Next, example of using the strncat_s() function is shown. The first argument(strDest) should have terminating null to concatenate strings. The second argument(numberOfElements) of the strncpy_s() function is specified with the buffer size including terminating null. For below example, when the first code is executed, five bytes(four chars + null) is stored. When the second code is executed, two chars are only copied into the buffer because the buffer size has two bytes. Finally, the buffer stores the "TeraTe"(4 chars + 2 chars + null).
   
 <pre class=code>
 char str[7];
@@ -356,9 +358,9 @@
 strncat_s(str, sizeof(str), "Tera", _TRUNCATE);
 strncat_s(str, sizeof(str), "Term", _TRUNCATE);
 </pre>
+    
+    Finally, the _snprintf_s() function uses. Confusingly, the _snprintf() does not use because terminating null may not be added into the buffer. Example of the _snprintf_s() function is below shown. The buf[] has the "ab\0".
 
-  最後に、_snprintf_s()です。紛らわしいのが _snprintf() という関数であり、この関数は<b>null-terminateされない</b>ケースがあるため、使用禁止です。以下に、_snprintf_s()の使用例を示します。以下の例では、buf[]には"ab\0"が格納されます。
-
 <pre class=code>
 char buf[3];
 _snprintf_s(buf, sizeof(buf), _TRUNCATE, "abcdef");
@@ -367,6 +369,7 @@
 
 <hr>
 
+    <!--
 
 
 <h2><a name="compatibility">古いバージョンのWindowsとの互換性維持</a></h2>



Ttssh2-commit メーリングリストの案内
Back to archive index