From 9c4428e8e406329e0e337cf0b2af9f69665976ed Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 26 Jun 2024 15:05:49 +0200 Subject: [PATCH] Resolves: RHEL-45186 (Fix issues found by Coverity Scan) --- 0002-coverity-scan-fixes.patch | 53 ++++++++++++++++++++++++++++++++++ gnome-online-accounts.spec | 6 +++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 0002-coverity-scan-fixes.patch diff --git a/0002-coverity-scan-fixes.patch b/0002-coverity-scan-fixes.patch new file mode 100644 index 0000000..e15d55a --- /dev/null +++ b/0002-coverity-scan-fixes.patch @@ -0,0 +1,53 @@ +diff -up gnome-online-accounts-3.50.2/src/goabackend/goafedoraprovider.c.2 gnome-online-accounts-3.50.2/src/goabackend/goafedoraprovider.c +--- gnome-online-accounts-3.50.2/src/goabackend/goafedoraprovider.c.2 2024-05-25 18:27:06.000000000 +0200 ++++ gnome-online-accounts-3.50.2/src/goabackend/goafedoraprovider.c 2024-06-26 14:48:43.970418551 +0200 +@@ -321,18 +321,24 @@ add_account_action_cb (GoaProviderDialog + return; + + /* Reset the temporary account watch */ +- g_free (data->identity); ++ g_clear_pointer (&data->identity, g_free); + g_clear_object (&data->object); + if (data->client_source != NULL) + { + g_source_destroy (data->client_source); + g_source_unref (data->client_source); ++ data->client_source = NULL; + } + + username = gtk_editable_get_text (GTK_EDITABLE (data->username)); + password = gtk_editable_get_text (GTK_EDITABLE (data->password)); + provider_type = goa_provider_get_provider_type (provider); +- parse_principal (username, &data->identity); ++ if (!parse_principal (username, &data->identity)) ++ { ++ error = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, _("Faild to get principal from user name ā€œ%sā€"), username); ++ goa_provider_task_return_error (task, g_steal_pointer (&error)); ++ return; ++ } + + /* If this is duplicate account we're finished */ + if (!goa_utils_check_duplicate (data->client, +diff -up gnome-online-accounts-3.50.2/src/goabackend/goautils.c.2 gnome-online-accounts-3.50.2/src/goabackend/goautils.c +--- gnome-online-accounts-3.50.2/src/goabackend/goautils.c.2 2024-05-25 18:27:06.000000000 +0200 ++++ gnome-online-accounts-3.50.2/src/goabackend/goautils.c 2024-06-26 14:48:43.970418551 +0200 +@@ -670,6 +670,7 @@ goa_utils_set_error_soup (GError **err, + case SOUP_STATUS_INTERNAL_SERVER_ERROR: + case SOUP_STATUS_NOT_IMPLEMENTED: + error_msg = g_strdup (_("Not supported")); ++ break; + + case SOUP_STATUS_NOT_FOUND: + error_msg = g_strdup (_("Not found")); +diff -up gnome-online-accounts-3.50.2/src/goabackend/goawebdavprovider.c.2 gnome-online-accounts-3.50.2/src/goabackend/goawebdavprovider.c +--- gnome-online-accounts-3.50.2/src/goabackend/goawebdavprovider.c.2 2024-06-26 14:50:38.747965297 +0200 ++++ gnome-online-accounts-3.50.2/src/goabackend/goawebdavprovider.c 2024-06-26 14:50:56.283201602 +0200 +@@ -1005,7 +1005,7 @@ refresh_account_action_cb (GoaProviderDi + username = gtk_editable_get_text (GTK_EDITABLE (data->username)); + password = gtk_editable_get_text (GTK_EDITABLE (data->password)); + +- g_free (data->presentation_identity); ++ g_clear_pointer (&data->presentation_identity, g_free); + uri = dav_normalize_uri (uri_text, NULL, &server); + if (strchr (username, '@') != NULL) + g_set_str (&data->presentation_identity, username); diff --git a/gnome-online-accounts.spec b/gnome-online-accounts.spec index c5ff7da..c5d7e06 100644 --- a/gnome-online-accounts.spec +++ b/gnome-online-accounts.spec @@ -5,7 +5,7 @@ Name: gnome-online-accounts Version: 3.50.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Single sign-on framework for GNOME License: LGPL-2.0-or-later @@ -13,6 +13,7 @@ URL: https://wiki.gnome.org/Projects/GnomeOnlineAccounts Source0: https://download.gnome.org/sources/gnome-online-accounts/3.50/%{name}-%{version}.tar.xz Patch: 0001-remove-google-files-backend.patch +Patch: 0002-coverity-scan-fixes.patch BuildRequires: pkgconfig(gcr-4) BuildRequires: pkgconfig(gio-2.0) >= %{glib2_version} @@ -117,6 +118,9 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/org.gnome.OnlineAcco %{_datadir}/vala/ %changelog +* Wed Jun 26 2024 Milan Crha - 3.50.2-3 +- Resolves: RHEL-45186 (Fix issues found by Coverity Scan) + * Mon Jun 24 2024 Troy Dawson - 3.50.2-2 - Bump release for June 2024 mass rebuild