From 3796f902a67ba1bcdeff27c5339907206185503b Mon Sep 17 00:00:00 2001 From: James Yonan Date: Sat, 10 Jul 2010 03:04:27 +0000 Subject: Fixed bug in proxy fallback capability where openvpn.exe could core dump if http-proxy-fallback-disable command was issued in response to ">PROXY:NEED_NOW management" interface notification. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6284 e7ae566f-a301-0410-adde-c780ea21d3b5 --- options.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'options.c') diff --git a/options.c b/options.c index bb377f6..305704f 100644 --- a/options.c +++ b/options.c @@ -1464,19 +1464,24 @@ parse_http_proxy_fallback (struct context *c, const char *flags, const int msglevel) { - struct gc_arena gc = gc_new (); + struct gc_arena gc = gc_new (); + struct http_proxy_options *ret = NULL; struct http_proxy_options *hp = parse_http_proxy_override(server, port, flags, msglevel, &gc); - struct hpo_store *hpos = c->options.hpo_store; - if (!hpos) + if (hp) { - ALLOC_OBJ_CLEAR_GC (hpos, struct hpo_store, &c->options.gc); - c->options.hpo_store = hpos; + struct hpo_store *hpos = c->options.hpo_store; + if (!hpos) + { + ALLOC_OBJ_CLEAR_GC (hpos, struct hpo_store, &c->options.gc); + c->options.hpo_store = hpos; + } + hpos->hpo = *hp; + hpos->hpo.server = hpos->server; + strncpynt(hpos->server, hp->server, sizeof(hpos->server)); + ret = &hpos->hpo; } - hpos->hpo = *hp; - hpos->hpo.server = hpos->server; - strncpynt(hpos->server, hp->server, sizeof(hpos->server)); gc_free (&gc); - return &hpos->hpo; + return ret; } static void -- cgit v1.2.3