Zebediah Figura : server: Allocate enough space for the backslash in dup_nt_name() (Valgrind).

Alexandre Julliard julliard at winehq.org
Fri Jan 21 15:54:47 CST 2022


Module: wine
Branch: master
Commit: 7b32a327f898cb2a8225669a2b945f0f606bf19e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7b32a327f898cb2a8225669a2b945f0f606bf19e

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Thu Jan 20 16:12:32 2022 -0600

server: Allocate enough space for the backslash in dup_nt_name() (Valgrind).

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/fd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/fd.c b/server/fd.c
index c9a21186722..1b4b98b0e76 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1867,7 +1867,7 @@ static WCHAR *dup_nt_name( struct fd *root, struct unicode_str name, data_size_t
         name.str++;
         name.len -= sizeof(WCHAR);
     }
-    if ((ret = malloc( retlen + name.len + 1 )))
+    if ((ret = malloc( retlen + name.len + sizeof(WCHAR) )))
     {
         memcpy( ret, root->nt_name, root->nt_namelen );
         if (name.len && name.str[0] != '\\' &&




More information about the wine-cvs mailing list