From b755539aa6ff56f9b7164db77cc0f9bc979ef984 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 27 Jan 2022 05:05:40 +0100 Subject: [PATCH] glib-aux: fix nm_ref_string_equal_str() Fix comparison with a NULL string. The only current caller is nm-supplicant-interface.c, and this bug causes a missing cleanup of the CurrentBSS property on disconnect. Fixes: ac8c3a711148 ('glib-aux: improve nm_ref_string_equals_str() to work for non-C-strings') https://bugzilla.redhat.com/show_bug.cgi?id=1983735 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1073 --- src/libnm-glib-aux/nm-ref-string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libnm-glib-aux/nm-ref-string.h b/src/libnm-glib-aux/nm-ref-string.h index 1d85c00e1a..577786acef 100644 --- a/src/libnm-glib-aux/nm-ref-string.h +++ b/src/libnm-glib-aux/nm-ref-string.h @@ -131,7 +131,7 @@ static inline gboolean nm_ref_string_equal_str(NMRefString *rstr, const char *str) { if (!str) - return (!!rstr); + return !rstr; if (!rstr) return FALSE;