mirror of
https://github.com/reactos/reactos.git
synced 2025-05-28 05:28:14 +00:00
[WINESYNC] msvcrt: memmove_s shouldn't zero its output buffer on error.
wine commit id 49560458426cf25b6a36bbf9bad35aa75c9f7aa7 by Dan Kegel <dank@kegel.com>
This commit is contained in:
parent
8fa0886fb9
commit
977e236102
1 changed files with 3 additions and 14 deletions
|
@ -715,20 +715,9 @@ int CDECL MSVCRT_memmove_s(void *dest, MSVCRT_size_t numberOfElements, const voi
|
|||
if(!count)
|
||||
return 0;
|
||||
|
||||
if(!dest || !src) {
|
||||
if(dest)
|
||||
memset(dest, 0, numberOfElements);
|
||||
|
||||
*_errno() = EINVAL;
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
if(count > numberOfElements) {
|
||||
memset(dest, 0, numberOfElements);
|
||||
|
||||
*_errno() = ERANGE;
|
||||
return ERANGE;
|
||||
}
|
||||
if (!MSVCRT_CHECK_PMT(dest != NULL)) return MSVCRT_EINVAL;
|
||||
if (!MSVCRT_CHECK_PMT(src != NULL)) return MSVCRT_EINVAL;
|
||||
if (!MSVCRT_CHECK_PMT_ERR( count <= numberOfElements, MSVCRT_ERANGE )) return MSVCRT_ERANGE;
|
||||
|
||||
memmove(dest, src, count);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue