Resolves: RHEL-45186 (Fix issues found by Coverity Scan)

This commit is contained in:
Milan Crha 2024-06-26 15:05:49 +02:00
parent 1074b2d727
commit 9c4428e8e4
2 changed files with 58 additions and 1 deletions

View File

@ -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);

View File

@ -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 <mcrha@redhat.com> - 3.50.2-3
- Resolves: RHEL-45186 (Fix issues found by Coverity Scan)
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 3.50.2-2
- Bump release for June 2024 mass rebuild