From: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> Date: Thu, 18 Sep 2025 18:08:33 +0000 (+0200) Subject: Address static analysis warning X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d079de01a72e61fbc572228565a9c40dec373768;p=users%2Fdwmw2%2Fopenconnect.git Address static analysis warning auth.c:717:14: warning: Access to field 'auth_id' results in a dereference of a null pointer (loaded from variable 'form') [core.NullDereference] 717 | if (!strcmp(form->auth_id, "success")) | ^~~~~~~~~~~~~ Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> --- diff --git a/auth.c b/auth.c index ec17c296..6fe669f7 100644 --- a/auth.c +++ b/auth.c @@ -714,6 +714,12 @@ static int handle_auth_form(struct openconnect_info *vpninfo, struct oc_auth_for int ret; struct oc_vpn_option *opt, *next; + if (!form) { + vpn_progress(vpninfo, PRG_DEBUG, + "The authentication form is NULL\n"); + return -EPERM; + } + if (!strcmp(form->auth_id, "success")) return OC_FORM_RESULT_LOGGEDIN;