[10108] Prevent access to out of range [0] element of empty string at utf8 convertion.

This commit is contained in:
VladimirMangos 2010-06-26 22:38:38 +04:00
parent 4e1c8a2ad6
commit 698fe93eb7
2 changed files with 3 additions and 2 deletions

View file

@ -297,6 +297,7 @@ bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr)
size_t len = utf8::distance(utf8str.c_str(),utf8str.c_str()+utf8str.size());
wstr.resize(len);
if (len)
utf8::utf8to16(utf8str.c_str(),utf8str.c_str()+utf8str.size(),&wstr[0]);
}
catch(std::exception)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10107"
#define REVISION_NR "10108"
#endif // __REVISION_NR_H__