[Ttssh2-commit] [7646] UTF8ToWideChar()#codeconv.cpp出力バッファポインタをNULLにしたときにクラッシュしないよう修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 5月 6日 (月) 22:41:33 JST


Revision: 7646
          https://osdn.net/projects/ttssh2/scm/svn/commits/7646
Author:   zmatsuo
Date:     2019-05-06 22:41:33 +0900 (Mon, 06 May 2019)
Log Message:
-----------
UTF8ToWideChar()#codeconv.cpp出力バッファポインタをNULLにしたときにクラッシュしないよう修正
u8,tcクラスの初期化でメンバ変数の初期化抜けを修正

Modified Paths:
--------------
    trunk/teraterm/common/codeconv.cpp

-------------- next part --------------
Modified: trunk/teraterm/common/codeconv.cpp
===================================================================
--- trunk/teraterm/common/codeconv.cpp	2019-05-06 13:41:25 UTC (rev 7645)
+++ trunk/teraterm/common/codeconv.cpp	2019-05-06 13:41:33 UTC (rev 7646)
@@ -781,11 +781,15 @@
 				}
 				u16_out = 2;
 			} else {
-				*wstr_ptr++ = '?';
+				if (wstr_ptr != NULL) {
+					*wstr_ptr++ = '?';
+				}
 				u16_out = 1;
 			}
 		} else {
-			*wstr_ptr++ = '?';
+			if (wstr_ptr != NULL) {
+				*wstr_ptr++ = '?';
+			}
 			u16_out = 1;
 		}
 
@@ -1007,6 +1011,7 @@
 
 u8::u8(const u8 &obj)
 {
+	u8str_ = NULL;
 	copy(obj);
 }
 
@@ -1013,6 +1018,7 @@
 #if defined(MOVE_CONSTRUCTOR_ENABLE)
 u8::u8(u8 &&obj) noexcept
 {
+	u8str_ = NULL;
 	move(obj);
 }
 #endif
@@ -1137,6 +1143,7 @@
 
 tc::tc(const tc &obj)
 {
+	tstr_ = NULL;
 	copy(obj);
 }
 


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