]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Pass correct buffer size to GetModuleFileNameW()
authorSelva Nair <selva.nair@gmail.com>
Fri, 12 May 2017 01:32:34 +0000 (21:32 -0400)
committerGert Doering <gert@greenie.muc.de>
Sat, 13 May 2017 18:12:15 +0000 (20:12 +0200)
Fixes finding 5.6 of OSTIF/Quarkslab audit

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1494552754-30060-1-git-send-email-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14647.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/win32.c

index 0cbf5fde5a7e61bbb3a5405ac09be26392f66ae6..9a0368144f71c63567ae7888ddd720181530b1eb 100644 (file)
@@ -1334,8 +1334,8 @@ win_wfp_block_dns(const NET_IFINDEX index, const HANDLE msg_channel)
         goto out;
     }
 
-    status = GetModuleFileNameW(NULL, openvpnpath, sizeof(openvpnpath));
-    if (status == 0 || status == sizeof(openvpnpath))
+    status = GetModuleFileNameW(NULL, openvpnpath, _countof(openvpnpath));
+    if (status == 0 || status == _countof(openvpnpath))
     {
         msg(M_WARN|M_ERRNO, "block_dns: cannot get executable path");
         goto out;