-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If openvpn is interrupted before openvpn_plugin_open_v1() is called,
there is no context allocated which openvpn_plugin_abort_v1() can use.

Signed-off-by: David Sommerseth <d...@users.sourceforge.net>

- ---
 plugin/down-root/down-root.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/plugin/down-root/down-root.c b/plugin/down-root/down-root.c
index 5e0c002..77497ad 100644
- --- a/plugin/down-root/down-root.c
+++ b/plugin/down-root/down-root.c
@@ -434,7 +434,7 @@ openvpn_plugin_abort_v1 (openvpn_plugin_handle_t handle)
 {
   struct down_root_context *context = (struct down_root_context *) handle;

- -  if (context->foreground_fd >= 0)
+  if (context && context->foreground_fd >= 0)
     {
       /* tell background process to exit */
       send_control (context->foreground_fd, COMMAND_EXIT);
- -- 
1.6.2.5

(patch attached in addition for convenience)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAksfbOUACgkQDC186MBRfrqSgwCeOZPg+70ryTCCyoW8D9QtLmeF
pwwAn2pWo9529hvBzlMgj8izabtG9Ioc
=o0Ym
-----END PGP SIGNATURE-----
>From e7e12e33025e7b83a8a97121433b46045144ded9 Mon Sep 17 00:00:00 2001
From: David Sommerseth <d...@users.sourceforge.net>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Wed, 9 Dec 2009 10:18:55 +0100
Subject: [PATCH] openvpn-down-root.so causes a segfault on premature exits

If openvpn is interrupted before openvpn_plugin_open_v1() is called,
there is no context allocated which openvpn_plugin_abort_v1() can use.

Signed-off-by: David Sommerseth <d...@users.sourceforge.net>

---
 plugin/down-root/down-root.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/plugin/down-root/down-root.c b/plugin/down-root/down-root.c
index 5e0c002..77497ad 100644
--- a/plugin/down-root/down-root.c
+++ b/plugin/down-root/down-root.c
@@ -434,7 +434,7 @@ openvpn_plugin_abort_v1 (openvpn_plugin_handle_t handle)
 {
   struct down_root_context *context = (struct down_root_context *) handle;

-  if (context->foreground_fd >= 0)
+  if (context && context->foreground_fd >= 0)
     {
       /* tell background process to exit */
       send_control (context->foreground_fd, COMMAND_EXIT);
-- 
1.6.2.5

Attachment: 0001-openvpn-down-root.so-causes-a-segfault-on-premature.patch.sig
Description: PGP signature

Reply via email to