https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4712deb8a87394e502cc1…
commit 4712deb8a87394e502cc1bdbed6bf9eaa7ef74ae
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sat Apr 3 00:51:23 2021 +0200
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Sat Apr 3 00:52:01 2021 +0200
[SETUPAPI] Fix wrong buffer size given to CM_Get_Device_ID_List_ExW
This buffer overflow was introduced in previous commit.
---
dll/win32/setupapi/devclass.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dll/win32/setupapi/devclass.c b/dll/win32/setupapi/devclass.c
index b8531b0093d..56398262437 100644
--- a/dll/win32/setupapi/devclass.c
+++ b/dll/win32/setupapi/devclass.c
@@ -142,7 +142,7 @@ SETUP_CreateDevicesList(
{
cr = CM_Get_Device_ID_List_ExW(Enumerator,
Buffer,
- BufferLength,
+ BufferLength / sizeof(WCHAR),
Enumerator ? CM_GETIDLIST_FILTER_ENUMERATOR :
CM_GETIDLIST_FILTER_NONE,
list->hMachine);
if (cr == CR_BUFFER_SMALL)