Fix segfault on 'ipsec stroke up ]' command
authorThomas Egerer <thomas.egerer@secunet.com>
Thu, 29 Jul 2010 11:03:01 +0000 (13:03 +0200)
committerMartin Willi <martin@revosec.ch>
Thu, 29 Jul 2010 12:03:11 +0000 (14:03 +0200)
src/libcharon/plugins/stroke/stroke_control.c

index a03aef6..f644215 100644 (file)
@@ -186,6 +186,11 @@ static void terminate(private_stroke_control_t *this, stroke_msg_t *msg, FILE *o
        }
        else
        {
+               if (!pos)
+               {
+                       DBG1(DBG_CFG, "error parsing string");
+                       return;
+               }
                if (*(pos + 1) == '*')
                {       /* is name[*] */
                        all = TRUE;