Fixed possible buffer overflow bug in unused WinWStrDupFromChar function (Patch #271)
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6781 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
3b8afc2e89
commit
765d245758
2 changed files with 11 additions and 1 deletions
|
@ -1,5 +1,15 @@
|
|||
\A{history} Changelog and Release Notes
|
||||
|
||||
\H{v3.01} 3.01
|
||||
|
||||
Released on ? ?th, 201?
|
||||
|
||||
\S1{v3.01-cl} Changelog
|
||||
|
||||
\S2{} Minor Changes
|
||||
|
||||
\b Fixed buffer size bug in winchar.cpp (\W{http://sf.net/p/nsis/patches/271}{patch #271})
|
||||
|
||||
\H{v3.0} 3.0
|
||||
|
||||
Released on July 24th, 2016
|
||||
|
|
|
@ -46,7 +46,7 @@ int WinWStrNICmpASCII(const WINWCHAR *a, const char *b, size_t n)
|
|||
WINWCHAR* WinWStrDupFromChar(const char *s, unsigned int cp)
|
||||
{
|
||||
int cch = MultiByteToWideChar(cp, 0, s, -1, 0, 0);
|
||||
wchar_t *p = (wchar_t*) malloc(cch);
|
||||
wchar_t *p = (wchar_t*) malloc(cch * sizeof(wchar_t));
|
||||
if (p)
|
||||
{
|
||||
MultiByteToWideChar(cp, 0, s, -1, p, cch);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue