]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Be a little more lenient about XML errors
authorDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 30 May 2013 14:27:12 +0000 (15:27 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 30 May 2013 14:38:45 +0000 (15:38 +0100)
Server admins have been observed to put bare ampersands into strings,
which libxml wants to treat as entities.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
auth.c
www/changelog.xml

diff --git a/auth.c b/auth.c
index c3bc4fbc720696ecd8e9db7c0af64a9b5815c6de..190208964ecd9055e76ef34da3fa99d57ea74418 100644 (file)
--- a/auth.c
+++ b/auth.c
@@ -509,8 +509,8 @@ int parse_xml_response(struct openconnect_info *vpninfo, char *response, struct
        form = calloc(1, sizeof(*form));
        if (!form)
                return -ENOMEM;
-
-       xml_doc = xmlReadMemory(response, strlen(response), "noname.xml", NULL, 0);
+       xml_doc = xmlReadMemory(response, strlen(response), "noname.xml", NULL,
+                               XML_PARSE_NOERROR|XML_PARSE_RECOVER);
        if (!xml_doc) {
                vpn_progress(vpninfo, PRG_ERR,
                             _("Failed to parse server response\n"));
index 4f4ad2eb5260f5e6fa824e9b5bb43eb48881ef4b..e4d2e55333612fe29913f25b2a2e0a81879c645b 100644 (file)
@@ -17,6 +17,7 @@
 <ul>
    <li><b>OpenConnect HEAD</b>
      <ul>
+       <li>Be more permissive in parsing XML forms.</li>
        <li>Use original URL when falling back to non-XML POST mode.</li>
        <li>Add <tt>--no-xmlpost</tt> option to revert to older, compatible behaviour.</li>
        <li>Close connection before falling back to non-xmlpost mode <a href="https://bugzilla.redhat.com/show_bug.cgi?id=964650"><i>(RH#964650)</i></a>.</li>