From 7a4dcd93ba3dfbe6698a1de9528a3e87390a99e3 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 4 Mar 2013 00:25:03 +0000 Subject: [PATCH] Don't attempt to parse empty response from server I couldn't trigger this until I hacked up stuff elsewhere to return artificial failures, but still... Signed-off-by: David Woodhouse --- auth.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/auth.c b/auth.c index 361f656c..ff2eae9d 100644 --- 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;