]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Ensure strings read from registry are null-terminated
authorSelva Nair <selva.nair@gmail.com>
Sat, 18 Nov 2017 17:40:57 +0000 (12:40 -0500)
committerGert Doering <gert@greenie.muc.de>
Tue, 20 Feb 2018 12:04:56 +0000 (13:04 +0100)
commitb00dab5422669fca7304f4af111b7c259b8a0a55
tree6cd981b56fa7d8ec20107c9aef82b52d63075c24
parent6725074ba0af914f85e6dbbef5eff08c2539c5b8
Ensure strings read from registry are null-terminated

- Strings stored in registry are not guaranteed to be null-terminated.
  So, use RegGetValue() instead of RegQueryValueEx() as the former
  adds null termination to the returned string if missing.
  (Needs Windows Vista+)

- While at it also add a default value parameter to GetRegString()
  to process optional registry values (such as ovpn_admin_group)
  without causing an otherwise confusing error logged to the
  eventlog[*].

[*] see Trac: #892

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1511026858-23281-1-git-send-email-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15893.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit b1263b06db40f21a8fd20e0efd0c12e37ce89a2c)
src/openvpnserv/common.c