From 808a702d05de982eb2e096d7c199c60f0fa1775c Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 28 Apr 2021 13:26:54 +0100 Subject: [PATCH] Ensure pulse_connect() can never attempt to monitor fd -1 Coverity wasn't sure that this could never happen. I'm *fairly* sure but let's add a check anyway. Signed-off-by: David Woodhouse --- pulse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pulse.c b/pulse.c index 2e18c7d2..280cc4a3 100644 --- a/pulse.c +++ b/pulse.c @@ -2568,10 +2568,14 @@ int pulse_connect(struct openconnect_info *vpninfo) if (!vpninfo->ip_info.mtu || (!vpninfo->ip_info.addr && !vpninfo->ip_info.addr6)) { - vpn_progress(vpninfo, PRG_ERR, "Insufficient configuration found\n"); + vpn_progress(vpninfo, PRG_ERR, _("Insufficient configuration found\n")); return -EINVAL; } + /* This should never happen, but be defensive and shut Coverity up */ + if (vpninfo->ssl_fd == -1) + return -EIO; + ret = 0; monitor_fd_new(vpninfo, ssl); monitor_read_fd(vpninfo, ssl); -- 2.50.1