[gnome-build-meta/alatiera/40-alpha] core-deps/libgweather.bst: needs another release to fix shell



commit b9f935d99eab8a7ed63e3c41bf8527397f7aeed8
Author: Jordan Petridis <jpetridis gnome org>
Date:   Fri Jan 15 01:45:29 2021 +0200

    core-deps/libgweather.bst: needs another release to fix shell
    
    there's a double free that prevetns shell from building
    there's a build failure

 elements/core-deps/libgweather.bst                 |  4 ++
 .../libgweather/nearest-station-double-free.patch  | 52 ++++++++++++++++++++++
 files/libgweather/remove-gweatherinfoclass.patch   | 36 +++++++++++++++
 3 files changed, 92 insertions(+)
---
diff --git a/elements/core-deps/libgweather.bst b/elements/core-deps/libgweather.bst
index ade2e960..1dc45f0d 100644
--- a/elements/core-deps/libgweather.bst
+++ b/elements/core-deps/libgweather.bst
@@ -3,6 +3,10 @@ sources:
 - kind: tar
   url: gnome_downloads:libgweather/40/libgweather-40.alpha.tar.xz
   ref: 9ce8f3142085b8cbd63bb1efbd6b15dc88f2f16d1724985866b559a1fa392877
+- kind: patch
+  path: files/libgweather/nearest-station-double-free.patch
+- kind: patch
+  path: files/libgweather/remove-gweatherinfoclass.patch
 build-depends:
 - sdk/vala.bst
 - freedesktop-sdk.bst:public-stacks/buildsystem-meson.bst
diff --git a/files/libgweather/nearest-station-double-free.patch 
b/files/libgweather/nearest-station-double-free.patch
new file mode 100644
index 00000000..9262ceb5
--- /dev/null
+++ b/files/libgweather/nearest-station-double-free.patch
@@ -0,0 +1,52 @@
+From 21e87d8f80326a2a1538dda9962c9a3d04befa9c Mon Sep 17 00:00:00 2001
+From: Georges Basile Stavracas Neto <georges stavracas gmail com>
+Date: Thu, 14 Jan 2021 17:23:46 -0300
+Subject: [PATCH] location: Fix double frees
+
+The 'nearest_station' argument of _gweather_location_new_detached()
+is transfer-full, which means a ref must be increased when passing
+this parameter.
+
+However, in various locations, g_autoptr was referencing the passed
+'nearest_station', which would cause double-frees down the line.
+
+Fix these double-frees by stealing the 'nearest_location' ref when
+passing it to _gweather_location_new_detached() when under g_autoptr.
+---
+ libgweather/gweather-location.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libgweather/gweather-location.c b/libgweather/gweather-location.c
+index d29959fe..c15e1190 100644
+--- a/libgweather/gweather-location.c
++++ b/libgweather/gweather-location.c
+@@ -1623,7 +1623,7 @@ gweather_location_common_deserialize (GWeatherLocation *world,
+      */
+     if (!latlon_valid)
+       return by_station_code
+-             ? _gweather_location_new_detached (by_station_code,
++             ? _gweather_location_new_detached (g_steal_pointer (&by_station_code),
+                                                 name, FALSE, 0, 0)
+              : NULL;
+ 
+@@ -1679,7 +1679,7 @@ gweather_location_common_deserialize (GWeatherLocation *world,
+     /* No weather station matches the serialized data, let's pick
+        one at random from the station code list */
+     if (by_station_code)
+-       return _gweather_location_new_detached (by_station_code,
++       return _gweather_location_new_detached (g_steal_pointer (&by_station_code),
+                                                name, TRUE, latitude, longitude);
+     else
+        return NULL;
+@@ -1857,7 +1857,7 @@ gweather_location_new_detached (const char *name,
+ 
+       latitude = DEGREES_TO_RADIANS (latitude);
+       longitude = DEGREES_TO_RADIANS (longitude);
+-      return _gweather_location_new_detached (city, name,
++      return _gweather_location_new_detached (g_steal_pointer (&city), name,
+                                               TRUE, latitude, longitude);
+     }
+ }
+-- 
+GitLab
+
diff --git a/files/libgweather/remove-gweatherinfoclass.patch 
b/files/libgweather/remove-gweatherinfoclass.patch
new file mode 100644
index 00000000..4ea7988e
--- /dev/null
+++ b/files/libgweather/remove-gweatherinfoclass.patch
@@ -0,0 +1,36 @@
+From f1f0bdd9ab47ff8ddba17e2125802c928226da64 Mon Sep 17 00:00:00 2001
+From: Michael Catanzaro <mcatanzaro gnome org>
+Date: Tue, 12 Jan 2021 14:36:19 -0600
+Subject: [PATCH] Remove _GWeatherInfoClass
+
+This struct is now final, so the class struct should no longer be
+public. This is breaking libgweather's gir file.
+
+https://gitlab.gnome.org/GNOME/gnome-build-meta/-/jobs/1084096
+---
+ libgweather/gweather-weather.h | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+diff --git a/libgweather/gweather-weather.h b/libgweather/gweather-weather.h
+index 69d31ad2..00134c2c 100644
+--- a/libgweather/gweather-weather.h
++++ b/libgweather/gweather-weather.h
+@@ -52,15 +52,6 @@ typedef enum { /*< flags, underscore_name=gweather_provider >*/
+ #define GWEATHER_TYPE_INFO (gweather_info_get_type ())
+ G_DECLARE_FINAL_TYPE(GWeatherInfo, gweather_info, GWEATHER, INFO, GObject)
+ 
+-struct _GWeatherInfoClass {
+-
+-    /*< private >*/
+-    GObjectClass parent_class;
+-
+-    /*< protected >*/
+-    void (*updated) (GWeatherInfo *info);
+-};
+-
+ GWeatherInfo *           gweather_info_new                 (GWeatherLocation *location);
+ void                     gweather_info_update              (GWeatherInfo *info);
+ void                   gweather_info_abort               (GWeatherInfo *info);
+-- 
+GitLab
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]