提交 1f5b73d3 编写于 作者: D dcherepanov

7012520: Heap overflow vulnerability in FileDialog.show()

Reviewed-by: art, anthony
上级 5d842fd2
...@@ -285,7 +285,7 @@ AwtFileDialog::Show(void *p) ...@@ -285,7 +285,7 @@ AwtFileDialog::Show(void *p)
file = (jstring)env->GetObjectField(target, AwtFileDialog::fileID); file = (jstring)env->GetObjectField(target, AwtFileDialog::fileID);
if (file != NULL) { if (file != NULL) {
LPCTSTR tmp = JNU_GetStringPlatformChars(env, file, NULL); LPCTSTR tmp = JNU_GetStringPlatformChars(env, file, NULL);
_tcscpy(fileBuffer, tmp); _tcsncpy(fileBuffer, tmp, bufferLimit - 2); // the fileBuffer is double null terminated string
JNU_ReleaseStringPlatformChars(env, file, tmp); JNU_ReleaseStringPlatformChars(env, file, tmp);
} else { } else {
fileBuffer[0] = _T('\0'); fileBuffer[0] = _T('\0');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册