shell32: Check array index limit first.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
40b211b6c2
commit
0dddf2a1ac
|
@ -613,7 +613,7 @@ static LPWSTR Stream_LoadPath( LPCSTR p, DWORD maxlen )
|
|||
int len = 0, wlen;
|
||||
LPWSTR path;
|
||||
|
||||
while( p[len] && (len < maxlen) )
|
||||
while( (len < maxlen) && p[len] )
|
||||
len++;
|
||||
|
||||
wlen = MultiByteToWideChar(CP_ACP, 0, p, len, NULL, 0);
|
||||
|
|
|
@ -341,7 +341,7 @@ static int dskentry_decode(const char *value, int len, char *output)
|
|||
while (pos<len)
|
||||
{
|
||||
char c;
|
||||
if (value[pos] == '\\' && pos<len-1)
|
||||
if (pos<len-1 && value[pos] == '\\')
|
||||
{
|
||||
pos++;
|
||||
switch (value[pos])
|
||||
|
|
Loading…
Reference in New Issue