Fix SEGV on cstp_reconnect() without deflate
authorDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 27 Jun 2012 18:58:55 +0000 (19:58 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 27 Jun 2012 19:06:51 +0000 (20:06 +0100)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
cstp.c
www/changelog.xml

diff --git a/cstp.c b/cstp.c
index ab5eba9..4da4698 100644 (file)
--- a/cstp.c
+++ b/cstp.c
@@ -529,13 +529,13 @@ int cstp_reconnect(struct openconnect_info *vpninfo)
 
        openconnect_close_https(vpninfo, 0);
 
-       /* Requeue the original packet that was deflated */
-       if (vpninfo->current_ssl_pkt == vpninfo->deflate_pkt) {
-               vpninfo->current_ssl_pkt = NULL;
-               queue_packet(&vpninfo->outgoing_queue, vpninfo->pending_deflated_pkt);
-               vpninfo->pending_deflated_pkt = NULL;
-       }
        if (vpninfo->deflate) {
+               /* Requeue the original packet that was deflated */
+               if (vpninfo->current_ssl_pkt == vpninfo->deflate_pkt) {
+                       vpninfo->current_ssl_pkt = NULL;
+                       queue_packet(&vpninfo->outgoing_queue, vpninfo->pending_deflated_pkt);
+                       vpninfo->pending_deflated_pkt = NULL;
+               }
                inflateEnd(&vpninfo->inflate_strm);
                deflateEnd(&vpninfo->deflate_strm);
        }
index d4307dc..a3d4c2c 100644 (file)
@@ -17,6 +17,7 @@
 <ul>
    <li><b>OpenConnect HEAD</b>
      <ul>
+       <li>Fix reconnect crash when compression is disabled.</li>
        <li>Fix build on systems like FreeBSD 8 without <tt>O_CLOEXEC</tt>.</li>
        <li>Add <tt>--dtls-local-port</tt> option.</li>
        <li>Print correct error when <tt>/dev/net/tun</tt> cannot be opened.</li>