components/gnome/glib2/patches/14-gstrerror.patch
author Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
Sat, 13 Aug 2016 23:42:23 -0700
changeset 6614 ff27f2901f5d
permissions -rw-r--r--
24458406 g_strerror caches and tries to reuse a pointer to a stack buffer

Fix from upstream git for:
Bug 24458406 - g_strerror caches and tries to reuse a pointer to a stack buffer

Included in later 2.48 release upstream.

From f87e002313d566dcce71a9aba040d22ddb5c1e80 Mon Sep 17 00:00:00 2001
From: Dan Winship <[email protected]>
Date: Mon, 16 Nov 2015 16:57:38 -0500
Subject: [PATCH] Fix g_strerror() on non-glibc

When using one of the codepaths that copies the error string into buf,
make sure the string gets strdup() afterward.

https://bugzilla.gnome.org/show_bug.cgi?id=758194
---
 glib/gstrfuncs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c
index b5a862b..975be0b 100644
--- a/glib/gstrfuncs.c
+++ b/glib/gstrfuncs.c
@@ -1293,6 +1293,8 @@ g_strerror (gint errnum)
           if (error)
             g_print ("%s\n", error->message);
         }
+      else if (msg == (const gchar *)buf)
+        msg = g_strdup (buf);
 
       g_hash_table_insert (errors, GINT_TO_POINTER (errnum), (char *) msg);
     }
-- 
2.7.4