Commit f2040b77 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Don't copy past end of buffer when removing a string from a multi string.

parent 916e38f9
......@@ -881,9 +881,11 @@ static BOOL CRYPT_RemoveStringFromMultiString(LPWSTR multi, LPCWSTR toRemove)
}
else
{
LPCWSTR nextStr = spotToRemove + lstrlenW(toRemove) + 1;
/* Copy remainder of string "left" */
memmove(spotToRemove, spotToRemove + lstrlenW(toRemove) + 1,
(len - (spotToRemove - multi)) * sizeof(WCHAR));
memmove(spotToRemove, nextStr,
(len - (nextStr - multi)) * sizeof(WCHAR));
}
ret = TRUE;
}
......
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