Module: wine Branch: master Commit: 2487a35372d97e947edc754b88f86f942023ccd2 URL: https://source.winehq.org/git/wine.git/?a=commit;h=2487a35372d97e947edc754b8...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Jun 15 11:18:17 2020 +0200
setupapi: Avoid storing uninitialized data in the registry.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/setupapi/devinst.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 5674062909..9dacde29ac 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -5023,7 +5023,7 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) static const WCHAR dotservicesW[] = {'.','S','e','r','v','i','c','e','s',0}; static const WCHAR addserviceW[] = {'A','d','d','S','e','r','v','i','c','e',0}; static const WCHAR rootW[] = {'r','o','o','t','\',0}; - WCHAR section[LINE_LEN], section_ext[LINE_LEN], subsection[LINE_LEN], inf_path[MAX_PATH], *extptr, *filepart; + WCHAR section_ext[LINE_LEN], subsection[LINE_LEN], inf_path[MAX_PATH], *extptr, *filepart; UINT install_flags = SPINST_ALL; HKEY driver_key, device_key; SC_HANDLE manager, service; @@ -5112,7 +5112,7 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) TRACE("Copied INF file %s to %s.\n", debugstr_w(driver->inf_path), debugstr_w(inf_path));
RegSetValueExW(driver_key, infpathW, 0, REG_SZ, (BYTE *)filepart, lstrlenW(filepart) * sizeof(WCHAR)); - RegSetValueExW(driver_key, infsectionW, 0, REG_SZ, (BYTE *)section, lstrlenW(section) * sizeof(WCHAR)); + RegSetValueExW(driver_key, infsectionW, 0, REG_SZ, (BYTE *)driver->section, lstrlenW(driver->section) * sizeof(WCHAR)); if (extptr) RegSetValueExW(driver_key, infsectionextW, 0, REG_SZ, (BYTE *)extptr, lstrlenW(extptr) * sizeof(WCHAR));