Gert Doering has uploaded a new patch set (#2) to the change originally created by Răzvan Cojocaru. ( https://gerrit.openvpn.net/c/openvpn/+/2376?usp=email )
The following approvals got outdated and were removed: Code-Review+2 by Frank Lichtenheld Change subject: tapctl: don't crash on a missing list --hwid value ...................................................................... tapctl: don't crash on a missing list --hwid value "tapctl list --hwid" without a value crashed in wcslen(), and a value too long for the hardware ID buffer made memcpy_s() fail. Warn and ignore --hwid in both cases, as the create command does. Change-Id: I21c051e6fa7b89904da2d4d6ec4770c94bc44af7 Signed-off-by: Razvan Cojocaru <[email protected]> Acked-by: Frank Lichtenheld <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2376 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg42244.html Signed-off-by: Gert Doering <[email protected]> --- M src/tapctl/main.c 1 file changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/76/2376/2 diff --git a/src/tapctl/main.c b/src/tapctl/main.c index 6697d14..12ab270 100644 --- a/src/tapctl/main.c +++ b/src/tapctl/main.c @@ -512,11 +512,20 @@ { if (wcsicmp(argv[i], L"--hwid") == 0) { + if (++i >= argc) + { + fwprintf(stderr, L"--hwid option requires a value. Ignored.\n"); + break; + } + /* leave room for the two terminating zeros */ + size_t len = wcslen(argv[i]); + if (len > _countof(szzHwId) - 2) + { + fwprintf(stderr, L"--hwid value is too long. Ignored.\n"); + continue; + } memset(szzHwId, 0, sizeof(szzHwId)); - ++i; - memcpy_s(szzHwId, - sizeof(szzHwId) - 2 * sizeof(WCHAR), - argv[i], wcslen(argv[i]) * sizeof(WCHAR)); + wmemcpy(szzHwId, argv[i], len); } else { -- To view, visit https://gerrit.openvpn.net/c/openvpn/+/2376?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I21c051e6fa7b89904da2d4d6ec4770c94bc44af7 Gerrit-Change-Number: 2376 Gerrit-PatchSet: 2 Gerrit-Owner: Răzvan Cojocaru <[email protected]> Gerrit-Reviewer: Arne Schwabe <[email protected]> Gerrit-Reviewer: Frank Lichtenheld <[email protected]> Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
