]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Don't attempt to parse empty response from server
authorDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 4 Mar 2013 00:25:03 +0000 (00:25 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 4 Mar 2013 00:48:37 +0000 (00:48 +0000)
I couldn't trigger this until I hacked up stuff elsewhere to return
artificial failures, but still...

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
auth.c

diff --git a/auth.c b/auth.c
index 361f656ce8e90cd13b76bd1430aa2e63c5f0d8e7..ff2eae9dc93b38ae3818196f8d8511ea12bbcd1a 100644 (file)
--- a/auth.c
+++ b/auth.c
@@ -493,6 +493,12 @@ int parse_xml_response(struct openconnect_info *vpninfo, char *response, struct
                *formp = NULL;
        }
 
+       if (!response) {
+               vpn_progress(vpninfo, PRG_TRACE,
+                            _("Empty response from server\n"));
+               return -EINVAL;
+       }
+
        form = calloc(1, sizeof(*form));
        if (!form)
                return -ENOMEM;