From d56f175bc2c38518960ebd6c7feaa84004af0b91 Mon Sep 17 00:00:00 2001 From: Alessandro Bono Date: Thu, 1 Sep 2022 10:26:29 +0200 Subject: gdm-session-auditor: Add missing guards in public functions --- daemon/gdm-session-auditor.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'daemon/gdm-session-auditor.c') diff --git a/daemon/gdm-session-auditor.c b/daemon/gdm-session-auditor.c index 5f569a9b..63f1666b 100644 --- a/daemon/gdm-session-auditor.c +++ b/daemon/gdm-session-auditor.c @@ -274,6 +274,8 @@ gdm_session_auditor_new (const char *hostname, void gdm_session_auditor_report_password_changed (GdmSessionAuditor *auditor) { + g_return_if_fail (GDM_IS_SESSION_AUDITOR (auditor)); + if (GDM_SESSION_AUDITOR_GET_CLASS (auditor)->report_password_changed != NULL) { GDM_SESSION_AUDITOR_GET_CLASS (auditor)->report_password_changed (auditor); } @@ -282,6 +284,8 @@ gdm_session_auditor_report_password_changed (GdmSessionAuditor *auditor) void gdm_session_auditor_report_password_change_failure (GdmSessionAuditor *auditor) { + g_return_if_fail (GDM_IS_SESSION_AUDITOR (auditor)); + if (GDM_SESSION_AUDITOR_GET_CLASS (auditor)->report_password_change_failure != NULL) { GDM_SESSION_AUDITOR_GET_CLASS (auditor)->report_password_change_failure (auditor); } @@ -290,6 +294,8 @@ gdm_session_auditor_report_password_change_failure (GdmSessionAuditor *auditor) void gdm_session_auditor_report_user_accredited (GdmSessionAuditor *auditor) { + g_return_if_fail (GDM_IS_SESSION_AUDITOR (auditor)); + if (GDM_SESSION_AUDITOR_GET_CLASS (auditor)->report_user_accredited != NULL) { GDM_SESSION_AUDITOR_GET_CLASS (auditor)->report_user_accredited (auditor); } @@ -298,6 +304,8 @@ gdm_session_auditor_report_user_accredited (GdmSessionAuditor *auditor) void gdm_session_auditor_report_login (GdmSessionAuditor *auditor) { + g_return_if_fail (GDM_IS_SESSION_AUDITOR (auditor)); + if (GDM_SESSION_AUDITOR_GET_CLASS (auditor)->report_login != NULL) { GDM_SESSION_AUDITOR_GET_CLASS (auditor)->report_login (auditor); } @@ -308,6 +316,8 @@ gdm_session_auditor_report_login_failure (GdmSessionAuditor *auditor, int error_code, const char *error_message) { + g_return_if_fail (GDM_IS_SESSION_AUDITOR (auditor)); + if (GDM_SESSION_AUDITOR_GET_CLASS (auditor)->report_login_failure != NULL) { GDM_SESSION_AUDITOR_GET_CLASS (auditor)->report_login_failure (auditor, error_code, error_message); } @@ -316,6 +326,8 @@ gdm_session_auditor_report_login_failure (GdmSessionAuditor *auditor, void gdm_session_auditor_report_logout (GdmSessionAuditor *auditor) { + g_return_if_fail (GDM_IS_SESSION_AUDITOR (auditor)); + if (GDM_SESSION_AUDITOR_GET_CLASS (auditor)->report_logout != NULL) { GDM_SESSION_AUDITOR_GET_CLASS (auditor)->report_logout (auditor); } -- cgit v1.2.1