<div dir="ltr">Please don&#39;t patch a patch, but fix the patch.<div><br></div><div>Ross</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 6 March 2018 at 00:04, Joe Slater <span dir="ltr">&lt;<a href="mailto:joe.slater@windriver.com" target="_blank">joe.slater@windriver.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">gnome-desktop-thumbnail-don-t-<wbr>convert-time_t-to-long.patch introduced<br>
a call to localtime() and a free() of the structure returned.  This is<br>
incorrect, as the structure is static.  For glibc 2.26, this will cause<br>
the program to abort.  Eliminate the free() and call localtime_r()<br>
which lets us allocate the tm structure.<br>
<br>
Signed-off-by: Joe Slater &lt;<a href="mailto:joe.slater@windriver.com">joe.slater@windriver.com</a>&gt;<br>
---<br>
 .../gnome-desktop/fix_<wbr>erroneous_free.patch         | 35 ++++++++++++++++++++++<br>
 .../gnome-desktop/<a href="http://gnome-desktop3_3.26.2.bb" rel="noreferrer" target="_blank">gnome-<wbr>desktop3_3.26.2.bb</a>         |  1 +<br>
 2 files changed, 36 insertions(+)<br>
 create mode 100644 meta/recipes-gnome/gnome-<wbr>desktop/gnome-desktop/fix_<wbr>erroneous_free.patch<br>
<br>
diff --git a/meta/recipes-gnome/gnome-<wbr>desktop/gnome-desktop/fix_<wbr>erroneous_free.patch b/meta/recipes-gnome/gnome-<wbr>desktop/gnome-desktop/fix_<wbr>erroneous_free.patch<br>
new file mode 100644<br>
index 0000000..c27e4d5<br>
--- /dev/null<br>
+++ b/meta/recipes-gnome/gnome-<wbr>desktop/gnome-desktop/fix_<wbr>erroneous_free.patch<br>
@@ -0,0 +1,35 @@<br>
+gnome-desktop3: eliminate erroneous free()<br>
+<br>
+Do not free() a static structure.  Use re-entrant localtime_r().<br>
+<br>
+Upstream-Status: Pending<br>
+<br>
+Signed-off-by: Joe Slater &lt;<a href="mailto:jslater@windriver.com">jslater@windriver.com</a>&gt;<br>
+<br>
+<br>
+--- a/libgnome-desktop/gnome-<wbr>desktop-thumbnail.c<br>
++++ b/libgnome-desktop/gnome-<wbr>desktop-thumbnail.c<br>
+@@ -1200,7 +1200,7 @@ save_thumbnail (GdkPixbuf  *pixbuf,<br>
+   char *tmp_path = NULL;<br>
+   int tmp_fd;<br>
+   char mtime_str[21];<br>
+-  struct tm *tmp_mtime = NULL;<br>
++  struct tm tmp_mtime;<br>
+   gboolean ret = FALSE;<br>
+   GError *error = NULL;<br>
+   const char *width, *height;<br>
+@@ -1220,11 +1220,10 @@ save_thumbnail (GdkPixbuf  *pixbuf,<br>
+     goto out;<br>
+   close (tmp_fd);<br>
+<br>
+-  tmp_mtime = localtime (&amp;mtime);<br>
+-  if (!tmp_mtime)<br>
++  if (!localtime_r (&amp;mtime,&amp;tmp_mtime))<br>
+     goto out;<br>
+-  strftime (mtime_str, 21, &quot;%s&quot;, tmp_mtime);<br>
+-  free (tmp_mtime);<br>
++<br>
++  strftime (mtime_str, 21, &quot;%s&quot;, &amp;tmp_mtime);<br>
+   width = gdk_pixbuf_get_option (pixbuf, &quot;tEXt::Thumb::Image::Width&quot;);<br>
+   height = gdk_pixbuf_get_option (pixbuf, &quot;tEXt::Thumb::Image::Height&quot;);<br>
+<br>
diff --git a/meta/recipes-gnome/gnome-<wbr>desktop/<a href="http://gnome-desktop3_3.26.2.bb" rel="noreferrer" target="_blank">gnome-desktop3_3.26.2.<wbr>bb</a> b/meta/recipes-gnome/gnome-<wbr>desktop/<a href="http://gnome-desktop3_3.26.2.bb" rel="noreferrer" target="_blank">gnome-desktop3_3.26.2.<wbr>bb</a><br>
index cd6c194..2cd3234 100644<br>
--- a/meta/recipes-gnome/gnome-<wbr>desktop/<a href="http://gnome-desktop3_3.26.2.bb" rel="noreferrer" target="_blank">gnome-desktop3_3.26.2.<wbr>bb</a><br>
+++ b/meta/recipes-gnome/gnome-<wbr>desktop/<a href="http://gnome-desktop3_3.26.2.bb" rel="noreferrer" target="_blank">gnome-desktop3_3.26.2.<wbr>bb</a><br>
@@ -14,6 +14,7 @@ SRC_URI += &quot; \<br>
            file://gnome-desktop-<wbr>thumbnail-don-t-convert-time_<wbr>t-to-long.patch \<br>
            file://0001-configure.ac-<wbr>Remove-gnome-common-macro-<wbr>calls.patch \<br>
            file://0001-Disable-<wbr>libseccomp-sycall-filtering-<wbr>mechanism.patch \<br>
+           file://fix_erroneous_free.<wbr>patch \<br>
            &quot;<br>
<br>
 DEPENDS += &quot;intltool-native gsettings-desktop-schemas gconf virtual/libx11 gtk+3 glib-2.0 startup-notification xkeyboard-config iso-codes udev&quot;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</font></span></blockquote></div><br></div>