Commit 0dddf2a1 authored by Andrey Gusev's avatar Andrey Gusev Committed by Alexandre Julliard

shell32: Check array index limit first.

parent 40b211b6
...@@ -613,7 +613,7 @@ static LPWSTR Stream_LoadPath( LPCSTR p, DWORD maxlen ) ...@@ -613,7 +613,7 @@ static LPWSTR Stream_LoadPath( LPCSTR p, DWORD maxlen )
int len = 0, wlen; int len = 0, wlen;
LPWSTR path; LPWSTR path;
while( p[len] && (len < maxlen) ) while( (len < maxlen) && p[len] )
len++; len++;
wlen = MultiByteToWideChar(CP_ACP, 0, p, len, NULL, 0); wlen = MultiByteToWideChar(CP_ACP, 0, p, len, NULL, 0);
......
...@@ -341,7 +341,7 @@ static int dskentry_decode(const char *value, int len, char *output) ...@@ -341,7 +341,7 @@ static int dskentry_decode(const char *value, int len, char *output)
while (pos<len) while (pos<len)
{ {
char c; char c;
if (value[pos] == '\\' && pos<len-1) if (pos<len-1 && value[pos] == '\\')
{ {
pos++; pos++;
switch (value[pos]) switch (value[pos])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment