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@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 089b2528c2
)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
parent
a59337fb7e
commit
83923e43d5
|
@ -402,6 +402,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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue