зеркало из https://github.com/mozilla/gecko-dev.git
#128154 Crash: opening non-ascii attachments
replace default "default char" from "?" to "_". r=ftang, sr=alecf.
This commit is contained in:
Родитель
98bab6ee7f
Коммит
a1a1517f87
|
@ -2171,9 +2171,12 @@ static nsresult UCS2toFS(const PRUnichar *aBuffer, char **aResult)
|
|||
if (!*aResult)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// default "defaultChar" is '?', which is an illegal character on windows file system.
|
||||
// That will cause file uncreatable. Change it to '_'
|
||||
const char defaultChar = '_';
|
||||
chars = ::WideCharToMultiByte(CP_ACP, 0,
|
||||
aBuffer, -1,
|
||||
*aResult, chars, NULL, NULL);
|
||||
*aResult, chars, &defaultChar, NULL);
|
||||
if (chars == 0)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче