]> 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 11:03:20 +0000 (12:03 +0100)
commitb1263b06db40f21a8fd20e0efd0c12e37ce89a2c
tree6a46ba90ffaaccd3ce4485d54e76854c0288f94e
parent7eca140c70ff76177371dc94c19aeb8644c2c3b5
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>
src/openvpnserv/common.c