summaryrefslogtreecommitdiffstats
path: root/options.c
diff options
context:
space:
mode:
authorJames Yonan <james@openvpn.net>2010-07-10 03:04:27 +0000
committerJames Yonan <james@openvpn.net>2010-07-10 03:04:27 +0000
commit3796f902a67ba1bcdeff27c5339907206185503b (patch)
treedd6a00bff733f852d887bb41b3e18fa28d770f40 /options.c
parent941132efc7d6087ca9f5f18c7af274f34f0473aa (diff)
downloadopenvpn-3796f902a67ba1bcdeff27c5339907206185503b.tar.gz
openvpn-3796f902a67ba1bcdeff27c5339907206185503b.tar.xz
openvpn-3796f902a67ba1bcdeff27c5339907206185503b.zip
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
Diffstat (limited to 'options.c')
-rw-r--r--options.c23
1 files changed, 14 insertions, 9 deletions
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