From ab9fb59f1dd259fdad6d4d326f2485fdf9a518e8 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 (cherry picked from commit b755539aa6ff56f9b7164db77cc0f9bc979ef984) (cherry picked from commit 4685651e7671e064b911a3a05f096908e5ef0580) --- 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 df37d5834b..e966aed084 100644 --- a/src/libnm-glib-aux/nm-ref-string.h +++ b/src/libnm-glib-aux/nm-ref-string.h @@ -118,7 +118,7 @@ static inline gboolean nm_ref_string_equal_str(NMRefString *rstr, const char *str) { if (!str) - return (!!rstr); + return !rstr; if (!rstr) return FALSE;