mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 10:37:01 +00:00
[10108] Prevent access to out of range [0] element of empty string at utf8 convertion.
This commit is contained in:
parent
4e1c8a2ad6
commit
698fe93eb7
2 changed files with 3 additions and 2 deletions
|
|
@ -297,7 +297,8 @@ bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr)
|
||||||
size_t len = utf8::distance(utf8str.c_str(),utf8str.c_str()+utf8str.size());
|
size_t len = utf8::distance(utf8str.c_str(),utf8str.c_str()+utf8str.size());
|
||||||
wstr.resize(len);
|
wstr.resize(len);
|
||||||
|
|
||||||
utf8::utf8to16(utf8str.c_str(),utf8str.c_str()+utf8str.size(),&wstr[0]);
|
if (len)
|
||||||
|
utf8::utf8to16(utf8str.c_str(),utf8str.c_str()+utf8str.size(),&wstr[0]);
|
||||||
}
|
}
|
||||||
catch(std::exception)
|
catch(std::exception)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10107"
|
#define REVISION_NR "10108"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue