From 0f037fbf2b51d1bade1b1f1b948723210856c81f Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 24 Oct 2020 14:41:22 +0100 Subject: [PATCH] Reduce called buffer size in QueryDosDevice as it was not returning a correct value. --- win32/list_devices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win32/list_devices.c b/win32/list_devices.c index d506672..0f2ee0f 100644 --- a/win32/list_devices.c +++ b/win32/list_devices.c @@ -56,12 +56,12 @@ DeviceInfoList* ListDevices() return NULL; } - QueryDosDevice(NULL, physical, 65536); + QueryDosDevice(NULL, physical, 65535); for(pos = physical; *pos; pos += strlen(pos) + 1) { if((strncmp(pos, "PhysicalDrive", 13) != 0 && strncmp(pos, "CdRom", 5) != 0) && strncmp(pos, "Tape", 4) != 0) - { continue; } + continue; sprintf_s(physId, 4096, "\\\\.\\%s", pos);