From 7793bd74b23d85b41621250a01f3495bfeef74f5 Mon Sep 17 00:00:00 2001 From: Mystro256 Date: Tue, 4 Oct 2016 22:28:56 -0400 Subject: [PATCH] Memory leak in last patch, as well, changed commit refence to 3.0 branch --- wxGTK3-3.0.2-fix-percent-dnd.patch | 4 ++-- wxGTK3-3.0.2-fix-percent-dnd2.patch | 35 +++++++++++++++++++++++++++++ wxGTK3.spec | 12 +++++++--- 3 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 wxGTK3-3.0.2-fix-percent-dnd2.patch diff --git a/wxGTK3-3.0.2-fix-percent-dnd.patch b/wxGTK3-3.0.2-fix-percent-dnd.patch index e887055..6f3f931 100644 --- a/wxGTK3-3.0.2-fix-percent-dnd.patch +++ b/wxGTK3-3.0.2-fix-percent-dnd.patch @@ -1,4 +1,4 @@ -commit 3b047b58ceb4a0bf11a607b3a5a47697d70de946 +commit 8f29de5231e348d356b5f3962225362e8fd87ba9 Author: Tim Kosse Date: Mon Sep 14 11:42:38 2015 +0200 @@ -14,7 +14,7 @@ Date: Mon Sep 14 11:42:38 2015 +0200 code. diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp -index d786257..1754d6c 100644 +index 9a39607..2d1f43c 100644 --- a/src/gtk/dataobj.cpp +++ b/src/gtk/dataobj.cpp @@ -235,16 +235,21 @@ wxTextDataObject::GetAllFormats(wxDataFormat *formats, diff --git a/wxGTK3-3.0.2-fix-percent-dnd2.patch b/wxGTK3-3.0.2-fix-percent-dnd2.patch new file mode 100644 index 0000000..772d477 --- /dev/null +++ b/wxGTK3-3.0.2-fix-percent-dnd2.patch @@ -0,0 +1,35 @@ +commit 0f9f942a5bbe0ed9f07ea2e1fef90a7e2db768e5 +Author: Paul Cornett +Date: Fri Oct 2 09:14:06 2015 -0700 + + Fix memory leak introduced in 8f29de52 + + Also, use memcpy() instead of strcpy() since we already have the length, + and use static_cast instead of reinterpret_cast. + +diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp +index 2d1f43c..df460d8 100644 +--- a/src/gtk/dataobj.cpp ++++ b/src/gtk/dataobj.cpp +@@ -235,7 +235,7 @@ wxTextDataObject::GetAllFormats(wxDataFormat *formats, + + bool wxFileDataObject::GetDataHere(void *buf) const + { +- char* out = reinterpret_cast(buf); ++ char* out = static_cast(buf); + + for (size_t i = 0; i < m_filenames.GetCount(); i++) + { +@@ -243,10 +243,11 @@ bool wxFileDataObject::GetDataHere(void *buf) const + if (uri) + { + size_t const len = strlen(uri); +- strcpy(out, uri); ++ memcpy(out, uri, len); + out += len; + *(out++) = '\r'; + *(out++) = '\n'; ++ g_free(uri); + } + } + *out = 0; diff --git a/wxGTK3.spec b/wxGTK3.spec index bbcf039..3875a7f 100644 --- a/wxGTK3.spec +++ b/wxGTK3.spec @@ -11,7 +11,7 @@ Name: %{wxgtkname} Version: 3.0.2 -Release: 25%{?dist} +Release: 26%{?dist} Summary: GTK port of the wxWidgets GUI library License: wxWidgets Group: System Environment/Libraries @@ -86,9 +86,11 @@ Patch16: %{name}-%{version}-wxgetkeystate.patch # https://github.com/wxWidgets/wxWidgets/commit/148971013ee48926dfe153ca39c94be92acde37c Patch17: %{name}-%{version}-draw-elliptic-arc-crash.patch # Fixes drag and drop issues with filenames containing percent symbols -# For more details, see the upstream commit: -# https://github.com/wxWidgets/wxWidgets/commit/3b047b58ceb4a0bf11a607b3a5a47697d70de946 +# For more details, see the upstream commits: +# https://github.com/wxWidgets/wxWidgets/commit/8f29de5231e348d356b5f3962225362e8fd87ba9 +# https://github.com/wxWidgets/wxWidgets/commit/0f9f942a5bbe0ed9f07ea2e1fef90a7e2db768e5 Patch18: %{name}-%{version}-fix-percent-dnd.patch +Patch19: %{name}-%{version}-fix-percent-dnd2.patch BuildRequires: gtk%{gtkver}-devel #Note webkitgtk (GTK2) does not appear to be supported @@ -360,6 +362,10 @@ fi %doc docs/doxygen/out/xml/* %changelog +* Tue Oct 04 2016 Jeremy Newton - 3.0.2-26 +- Memory leak in last patch, add patch to fix it +- Change last patch to 3.0 branch for consistency + * Tue Oct 04 2016 Jeremy Newton - 3.0.2-25 - Add patch to fix bug 1381767 - Clean up spec file with autosetup