Paul Gofman : hnetcfg: Fix realloc handling in fw_app_put_ProcessImageFileName().
Alexandre Julliard
julliard at winehq.org
Wed Feb 2 16:38:02 CST 2022
Module: wine
Branch: master
Commit: 42b2a69a67b78163a1b2ed091dee0abd74745c57
URL: https://source.winehq.org/git/wine.git/?a=commit;h=42b2a69a67b78163a1b2ed091dee0abd74745c57
Author: Paul Gofman <pgofman at codeweavers.com>
Date: Wed Feb 2 11:32:53 2022 +0300
hnetcfg: Fix realloc handling in fw_app_put_ProcessImageFileName().
Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/hnetcfg/apps.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/hnetcfg/apps.c b/dlls/hnetcfg/apps.c
index c5fe5e41f5e..f351e2482e8 100644
--- a/dlls/hnetcfg/apps.c
+++ b/dlls/hnetcfg/apps.c
@@ -269,7 +269,7 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
UNIVERSAL_NAME_INFOW *info;
DWORD sz, longsz;
- WCHAR *path;
+ WCHAR *path, *new_path;
DWORD res;
FIXME("%p, %s\n", This, debugstr_w(image));
@@ -303,11 +303,12 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
longsz = GetLongPathNameW(path, path, sz);
if (longsz > sz)
{
- if (!(path = realloc(path, longsz * sizeof(WCHAR))))
+ if (!(new_path = realloc(path, longsz * sizeof(WCHAR))))
{
free(path);
return E_OUTOFMEMORY;
}
+ path = new_path;
GetLongPathNameW(path, path, longsz);
}
More information about the wine-cvs
mailing list