]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
fix crash when we receive unknown protocol before agreeing on MRU/MTU
authorDaniel Lenski <dlenski@gmail.com>
Tue, 19 May 2020 21:51:33 +0000 (14:51 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Wed, 20 May 2020 00:10:59 +0000 (17:10 -0700)
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
ppp.c

diff --git a/ppp.c b/ppp.c
index 4ebd1a45f06e58e2e8d991d8a6d97203a087da68..9369aa02b0e12328e3bee55ee458d251fad43722 100644 (file)
--- a/ppp.c
+++ b/ppp.c
@@ -1147,7 +1147,7 @@ int ppp_mainloop(struct openconnect_info *vpninfo, int *timeout, int readable)
                         */
                        store_be16(pp - 2, proto);
                        if ((ret = queue_config_packet(vpninfo, PPP_LCP, ++ppp->lcp.id, PROTREJ,
-                                                      MIN(payload_len + 2, vpninfo->ip_info.mtu - 10),
+                                                      MIN(payload_len + 2, (vpninfo->ip_info.mtu ?: 256) - 10),
                                                       pp - 2)) < 0)
                                return ret;
                }