https://git.reactos.org/?p=reactos.git;a=commitdiff;h=aa05649902f0afac18ca6…
commit aa05649902f0afac18ca6fa2bdf2ff8846c915ad
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Sun Dec 6 19:49:57 2020 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Sun Dec 6 19:49:57 2020 +0300
[SETUPAPI] Do not use strlen on buffers which may possibly contain REG_MULTI_SZ
CORE-14187
---
dll/win32/setupapi/cfgmgr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c
index fdbcc8cfb1b..b052553e9ac 100644
--- a/dll/win32/setupapi/cfgmgr.c
+++ b/dll/win32/setupapi/cfgmgr.c
@@ -2937,7 +2937,7 @@ CM_Get_Class_Registry_PropertyA(
*pulLength = WideCharToMultiByte(CP_ACP,
0,
BufferW,
- lstrlenW(BufferW) + 1,
+ ulLength,
Buffer,
*pulLength,
NULL,
@@ -3859,7 +3859,7 @@ CM_Get_Device_ID_List_ExA(
if (WideCharToMultiByte(CP_ACP,
0,
BufferW,
- lstrlenW(BufferW) + 1,
+ BufferLen,
Buffer,
BufferLen,
NULL,
@@ -4344,7 +4344,7 @@ CM_Get_Device_Interface_List_ExA(
if (WideCharToMultiByte(CP_ACP,
0,
BufferW,
- lstrlenW(BufferW) + 1,
+ BufferLen,
Buffer,
BufferLen,
NULL,