crypt32: Don't copy past end of buffer when removing a string from a multi string.
This commit is contained in:
parent
916e38f969
commit
f2040b7725
|
@ -881,9 +881,11 @@ static BOOL CRYPT_RemoveStringFromMultiString(LPWSTR multi, LPCWSTR toRemove)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
LPCWSTR nextStr = spotToRemove + lstrlenW(toRemove) + 1;
|
||||||
|
|
||||||
/* Copy remainder of string "left" */
|
/* Copy remainder of string "left" */
|
||||||
memmove(spotToRemove, spotToRemove + lstrlenW(toRemove) + 1,
|
memmove(spotToRemove, nextStr,
|
||||||
(len - (spotToRemove - multi)) * sizeof(WCHAR));
|
(len - (nextStr - multi)) * sizeof(WCHAR));
|
||||||
}
|
}
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue