mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-05-28 04:03:29 -04:00
When parsing '--setenv opt xx ..' make sure a third parameter is present
When no parameters are present, set it to "setenv opt" to trigger a descriptive error message. And, thus get rid of the pesky NULL pointer dereferencing. Trac: #779 Signed-off-by: Selva Nair <selva.nair@gmail.com> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <1480470794-6349-1-git-send-email-selva.nair@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg13311.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
parent
009521ac8a
commit
9977953539
1 changed files with 2 additions and 0 deletions
|
|
@ -4407,6 +4407,8 @@ add_option (struct options *options,
|
|||
*/
|
||||
if (streq (p[0], "setenv") && p[1] && streq (p[1], "opt") && !(permission_mask & OPT_P_PULL_MODE))
|
||||
{
|
||||
if (!p[2])
|
||||
p[2] = "setenv opt"; /* will trigger an error that includes setenv opt */
|
||||
p += 2;
|
||||
msglevel_fc = M_WARN;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue