libmateweather: fix double free

This commit is contained in:
Đoàn Trần Công Danh 2025-04-18 09:33:05 +07:00
parent d90789b2fa
commit 79a6cd629e
2 changed files with 48 additions and 7 deletions

View file

@ -1,4 +1,4 @@
From 97cd9b061ad9b75568af3737f7e4a1dd4bed9c1a Mon Sep 17 00:00:00 2001 From 52487e56c267328d45f1867cef0e4f4d7e4e6aa7 Mon Sep 17 00:00:00 2001
From: Đoàn Trần Công Danh <congdanhqx@gmail.com> From: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Date: Mon, 4 Mar 2024 23:47:37 +0700 Date: Mon, 4 Mar 2024 23:47:37 +0700
Subject: [PATCH] Port to libsoup-3.0 Subject: [PATCH] Port to libsoup-3.0
@ -11,12 +11,54 @@ Subject: [PATCH] Port to libsoup-3.0
libmateweather/weather-bom.c | 36 ++++++++----- libmateweather/weather-bom.c | 36 ++++++++-----
libmateweather/weather-iwin.c | 37 ++++++++----- libmateweather/weather-iwin.c | 37 ++++++++-----
libmateweather/weather-met.c | 34 ++++++++---- libmateweather/weather-met.c | 34 ++++++++----
libmateweather/weather-metar.c | 57 ++++++++++++++------ libmateweather/weather-metar.c | 56 ++++++++++++++------
libmateweather/weather-priv.h | 6 ++- libmateweather/weather-priv.h | 6 ++-
libmateweather/weather-wx.c | 53 +++++++++--------- libmateweather/weather-wx.c | 53 +++++++++---------
libmateweather/weather.c | 7 +-- libmateweather/weather.c | 7 +--
11 files changed, 157 insertions(+), 93 deletions(-) 11 files changed, 156 insertions(+), 93 deletions(-)
diff --git a/.build.yml b/.build.yml
index 622db50..024b8f4 100644
--- a/.build.yml
+++ b/.build.yml
@@ -9,7 +9,7 @@ requires:
- gcc
- git
- gtk3
- - libsoup
+ - libsoup3
- make
- mate-common
- tzdata
@@ -27,8 +27,7 @@ requires:
- gtk-doc-tools
- libglib2.0-dev
- libgtk-3-dev
- - libsoup-gnome2.4-dev
- - libsoup2.4-dev
+ - libsoup-3.0-dev
- libxml2-dev
- libxml2-utils
- make
@@ -44,7 +43,7 @@ requires:
- gcc
- git
- gtk3-devel
- - libsoup-devel
+ - libsoup3-devel
- libxml2-devel
- make
- mate-common
@@ -60,8 +59,7 @@ requires:
- gtk-doc-tools
- libglib2.0-dev
- libgtk-3-dev
- - libsoup-gnome2.4-dev
- - libsoup2.4-dev
+ - libsoup-3.0-dev
- libxml2-dev
- libxml2-utils
- make
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index 133108e..d9fcf9c 100644 index 133108e..d9fcf9c 100644
--- a/configure.ac --- a/configure.ac
@ -317,7 +359,7 @@ index 164e9f2..7022abb 100644
info->requests_pending++; info->requests_pending++;
diff --git a/libmateweather/weather-metar.c b/libmateweather/weather-metar.c diff --git a/libmateweather/weather-metar.c b/libmateweather/weather-metar.c
index 7bc24fc..d85188b 100644 index 7bc24fc..d470822 100644
--- a/libmateweather/weather-metar.c --- a/libmateweather/weather-metar.c
+++ b/libmateweather/weather-metar.c +++ b/libmateweather/weather-metar.c
@@ -486,43 +486,60 @@ metar_parse (gchar *metar, WeatherInfo *info) @@ -486,43 +486,60 @@ metar_parse (gchar *metar, WeatherInfo *info)
@ -422,7 +464,7 @@ index 7bc24fc..d85188b 100644
"dataSource", "metars", "dataSource", "metars",
"requestType", "retrieve", "requestType", "retrieve",
"format", "xml", "format", "xml",
@@ -559,7 +577,12 @@ metar_start_open (WeatherInfo *info) @@ -559,7 +577,11 @@ metar_start_open (WeatherInfo *info)
"fields", "raw_text", "fields", "raw_text",
"stationString", loc->code, "stationString", loc->code,
NULL); NULL);
@ -430,7 +472,6 @@ index 7bc24fc..d85188b 100644
+ msg = soup_message_new_from_encoded_form ( + msg = soup_message_new_from_encoded_form (
+ "GET", "https://aviationweather.gov/cgi-bin/data/dataserver.php", + "GET", "https://aviationweather.gov/cgi-bin/data/dataserver.php",
+ query); + query);
+ g_free(query);
+ soup_session_send_and_read_async (info->session, msg, G_PRIORITY_DEFAULT, + soup_session_send_and_read_async (info->session, msg, G_PRIORITY_DEFAULT,
+ NULL, metar_finish, info); + NULL, metar_finish, info);

View file

@ -1,7 +1,7 @@
# Template file for 'libmateweather' # Template file for 'libmateweather'
pkgname=libmateweather pkgname=libmateweather
version=1.28.0 version=1.28.0
revision=1 revision=2
build_style=gnu-configure build_style=gnu-configure
configure_args="--disable-static --enable-locations-compression configure_args="--disable-static --enable-locations-compression
--with-zoneinfo-dir=/usr/share/zoneinfo" --with-zoneinfo-dir=/usr/share/zoneinfo"