diff options
author | James Yonan <james@openvpn.net> | 2010-07-10 03:04:27 +0000 |
---|---|---|
committer | James Yonan <james@openvpn.net> | 2010-07-10 03:04:27 +0000 |
commit | 3796f902a67ba1bcdeff27c5339907206185503b (patch) | |
tree | dd6a00bff733f852d887bb41b3e18fa28d770f40 /options.c | |
parent | Added support for MSVC debugging of openvpn.exe in settings.in: (diff) | |
download | openvpn-3796f902a67ba1bcdeff27c5339907206185503b.tar.xz |
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.c | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -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 |