https://git.reactos.org/?p=reactos.git;a=commitdiff;h=977e236102b4be50d473c…
commit 977e236102b4be50d473c397fa6aeca12fc2a166
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sat Jul 28 19:43:43 2012 +0300
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Thu Feb 2 14:58:08 2023 +0100
[WINESYNC] msvcrt: memmove_s shouldn't zero its output buffer on error.
wine commit id 49560458426cf25b6a36bbf9bad35aa75c9f7aa7 by Dan Kegel
<dank(a)kegel.com>
---
sdk/lib/crt/wine/heap.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/sdk/lib/crt/wine/heap.c b/sdk/lib/crt/wine/heap.c
index 8fc3f6c37f1..5cf7d6bd4ee 100644
--- a/sdk/lib/crt/wine/heap.c
+++ b/sdk/lib/crt/wine/heap.c
@@ -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;