Module: wine
Branch: oldstable
Commit: 7a9898344d61ad4d8619f2bbb3ffe037f180ff3b
URL: https://source.winehq.org/git/wine.git/?a=commit;h=7a9898344d61ad4d8619f2bb…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Aug 26 13:16:12 2021 +0200
gdiplus: GdipGetFamilyName() should not crash when given a NULL name.
It used to crash on Windows XP and Vista but does not since Windows 7.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Esme Povirk <esme(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
(cherry picked from commit ad663360fae6b4a9ee3d7786857404e0a4917329)
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/gdiplus/font.c | 7 +++++--
dlls/gdiplus/tests/font.c | 9 +++------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index c18e5702ca2..4d0a84943ea 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -798,17 +798,20 @@ GpStatus WINGDIPAPI GdipCloneFontFamily(GpFontFamily *family, GpFontFamily **clo
* FAILURE: InvalidParameter if family is NULL
*
* NOTES
- * If name is a NULL ptr, then both XP and Vista will crash (so we do as well)
+ * If name is NULL, XP and Vista crash but not Windows 7+
*/
GpStatus WINGDIPAPI GdipGetFamilyName (GDIPCONST GpFontFamily *family,
WCHAR *name, LANGID language)
{
static int lang_fixme;
+ TRACE("%p, %p, %d\n", family, name, language);
+
if (family == NULL)
return InvalidParameter;
- TRACE("%p, %p, %d\n", family, name, language);
+ if (name == NULL)
+ return Ok;
if (language != LANG_NEUTRAL && !lang_fixme++)
FIXME("No support for handling of multiple languages!\n");
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c
index b208989c054..4ffa9e823fc 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -388,12 +388,9 @@ static void test_fontfamily (void)
expect (Ok, stat);
expect (0, lstrcmpiW(itsName, L"Tahoma"));
- if (0)
- {
- /* Crashes on Windows XP SP2, Vista, and so Wine as well */
- stat = GdipGetFamilyName (family, NULL, LANG_NEUTRAL);
- expect (Ok, stat);
- }
+ /* Crashes on Windows XP SP2 and Vista */
+ stat = GdipGetFamilyName (family, NULL, LANG_NEUTRAL);
+ expect (Ok, stat);
/* Make sure we don't read old data */
ZeroMemory (itsName, sizeof(itsName));
Module: wine
Branch: oldstable
Commit: 83923e43d57d624f52ef478bfb18d7f0fb6a91e1
URL: https://source.winehq.org/git/wine.git/?a=commit;h=83923e43d57d624f52ef478b…
Author: Zebediah Figura <z.figura12(a)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(a)gmail.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
(cherry picked from commit 089b2528c2c933e3c9b45a5f559fa4b5f830872a)
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
server/registry.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/server/registry.c b/server/registry.c
index c937e051597..49601bda77e 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -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;