From 9016b2d5c67fedc58821e441c262a128bb7dbe3c Mon Sep 17 00:00:00 2001 From: Fabiano FidĂȘncio Date: Jun 23 2015 09:00:16 +0000 Subject: Fix Windows XP inet_pton() Emulation (GNOME Bug 730352 comment #24) --- diff --git a/gio-ginetaddress.c-Fix-Windows-XP-inet_pton-Emulatio.patch b/gio-ginetaddress.c-Fix-Windows-XP-inet_pton-Emulatio.patch new file mode 100644 index 0000000..6e411e5 --- /dev/null +++ b/gio-ginetaddress.c-Fix-Windows-XP-inet_pton-Emulatio.patch @@ -0,0 +1,42 @@ +From 3e29dadae46fe4d1e26ff91c30d9d3b84eb6d84e Mon Sep 17 00:00:00 2001 +From: Chun-wei Fan +Date: Tue, 23 Jun 2015 13:52:25 +0800 +Subject: [PATCH] gio/ginetaddress.c: Fix Windows XP inet_pton() Emulation + +We need to be more careful when we try to assign values to gpointers, so +that means we have to assign the value to the properly-dereference +gpointer, so that the assigned value will be retained after the function +returns. This code will be dropped soon, but it is done for XP +compatibility's sake for 2.44. + +Should fix the issue reported in bug 730352 comment #24. +--- + gio/ginetaddress.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/gio/ginetaddress.c b/gio/ginetaddress.c +index 8723c28..39610ae 100644 +--- a/gio/ginetaddress.c ++++ b/gio/ginetaddress.c +@@ -417,7 +417,8 @@ inet_pton (gint family, + /* XXX: Figure out when WSAStringToAddress() accepts a IPv4 address but the + numbers-and-dots address is actually not complete. This code will be + removed once XP/Server 2003 support is dropped... */ +- addr = &sin->sin_addr; ++ *(IN_ADDR *) addr = sin->sin_addr; ++ + return 1; + } + } +@@ -425,7 +426,7 @@ inet_pton (gint family, + { + if (WSAStringToAddress ((LPTSTR) addr_string, AF_INET6, NULL, (LPSOCKADDR) &sa, &len) == 0) + { +- addr = &sin6->sin6_addr; ++ *(IN6_ADDR *) addr = sin6->sin6_addr; + return 1; + } + } +-- +2.4.4 + diff --git a/mingw-glib2.spec b/mingw-glib2.spec index 21b3fb8..c20923f 100644 --- a/mingw-glib2.spec +++ b/mingw-glib2.spec @@ -2,7 +2,7 @@ Name: mingw-glib2 Version: 2.44.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: MinGW Windows GLib2 library License: LGPLv2+ @@ -57,6 +57,9 @@ Patch5: glib-prefer-constructors-over-DllMain.patch # https://bugzilla.gnome.org/show_bug.cgi?id=733338 Patch8: 0002-GNetworkMonitorBase-don-t-fail-when-IPv6-support-is-.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=730352#c27 +Patch9: gio-ginetaddress.c-Fix-Windows-XP-inet_pton-Emulatio.patch + %description MinGW Windows Glib2 library. @@ -102,6 +105,7 @@ Static version of the MinGW Windows GLib2 library. %patch3 -p0 %patch5 -p1 %patch8 -p1 +%patch9 -p1 %build @@ -282,6 +286,10 @@ find $RPM_BUILD_ROOT -name "*.la" -delete %changelog +* Tue Jun 23 2015 Fabiano FidĂȘncio - 2.44.0-4 +- gio/ginetaddress.c: Fix Windows XP inet_pton() Emulation + (https://bugzilla.gnome.org/show_bug.cgi?id=730352#c24) + * Wed Jun 17 2015 Fedora Release Engineering - 2.44.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild