]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
asprintf() returns -1 on error
authorDaniel Lenski <dlenski@gmail.com>
Thu, 27 Dec 2018 23:13:32 +0000 (15:13 -0800)
committerDaniel Lenski <dlenski@gmail.com>
Thu, 27 Dec 2018 23:13:32 +0000 (15:13 -0800)
Fixes the bugs reported on the mailing list and Ubuntu tracker…

- http://lists.infradead.org/pipermail/openconnect-devel/2018-December/005164.html "Failed to obtain WebVPN cookie introduced by f08767d9644029bd3ac0e83bf160a7bf03a5c8de"
- https://bugs.launchpad.net/bugs/1809839 "[Bug 1809839] [NEW] Daily build 2667 broken for protocol=GP"

auth-globalprotect.c

index 399369d7aa46db341375f26c586fa4ef0ddfcf0c..8cc543b57bdaf94efe737d1ec8c26b9bde42a54c 100644 (file)
@@ -458,7 +458,7 @@ static int gpst_login(struct openconnect_info *vpninfo, int portal, struct login
                /* submit prelogin request to get form */
                orig_path = vpninfo->urlpath;
                if (asprintf(&vpninfo->urlpath, "%s/prelogin.esp?tmp=tmp&clientVer=4100&clientos=%s",
-                            portal ? "global-protect" : "ssl-vpn", clientos)) {
+                            portal ? "global-protect" : "ssl-vpn", clientos) < 0) {
                        result = -ENOMEM;
                        goto out;
                }