Zebediah Figura : server: Return STATUS_KEY_DELETED when trying to retrieve the full name of a deleted key.

Alexandre Julliard julliard at winehq.org
Thu Jul 1 15:53:49 CDT 2021


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Wed Jun 30 22:08:09 2021 -0500

server: Return STATUS_KEY_DELETED when trying to retrieve the full name of a deleted key.

This fixes a server crash that can be triggered by deleting a key and then
trying to retrieve its name. In that case key->parent is NULL.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/registry.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/server/registry.c b/server/registry.c
index f36760e6cc1..b7971770728 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -413,6 +413,12 @@ static WCHAR *key_get_full_name( struct object *obj, data_size_t *ret_len )
     data_size_t len = sizeof(root_name) - sizeof(WCHAR);
     char *ret;
 
+    if (key->flags & KEY_DELETED)
+    {
+        set_error( STATUS_KEY_DELETED );
+        return NULL;
+    }
+
     for (key = (struct key *)obj; key != root_key; key = key->parent) len += key->namelen + sizeof(WCHAR);
     if (!(ret = malloc( len ))) return NULL;
 




More information about the wine-cvs mailing list