Don't read uninitialized data when a '$' is found.
This commit is contained in:
parent
60b28eedfd
commit
8e94fbf305
|
@ -120,7 +120,8 @@ static void PROFILE_CopyEntry( LPWSTR buffer, LPCWSTR value, int len,
|
|||
return;
|
||||
}
|
||||
|
||||
for (p = value; (*p && (len > 1)); *buffer++ = *p++, len-- )
|
||||
p = value;
|
||||
while (*p && (len > 1))
|
||||
{
|
||||
if ((*p == '$') && (p[1] == '{'))
|
||||
{
|
||||
|
@ -140,6 +141,11 @@ static void PROFILE_CopyEntry( LPWSTR buffer, LPCWSTR value, int len,
|
|||
}
|
||||
p = p2 + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
*buffer++ = *p++;
|
||||
len--;
|
||||
}
|
||||
}
|
||||
if (quote && (len > 1)) buffer--;
|
||||
*buffer = '\0';
|
||||
|
|
Loading…
Reference in New Issue