Memory leak in last patch, as well, changed commit refence to 3.0 branch

epel8
Mystro256 8 years ago
parent e523d939e9
commit 7793bd74b2

@ -1,4 +1,4 @@
commit 3b047b58ceb4a0bf11a607b3a5a47697d70de946
commit 8f29de5231e348d356b5f3962225362e8fd87ba9
Author: Tim Kosse <tim.kosse@filezilla-project.org>
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,

@ -0,0 +1,35 @@
commit 0f9f942a5bbe0ed9f07ea2e1fef90a7e2db768e5
Author: Paul Cornett <paulcor@users.noreply.github.com>
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<char*>(buf);
+ char* out = static_cast<char*>(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;

@ -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 <alexjnewt AT hotmail DOT com> - 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 <alexjnewt AT hotmail DOT com> - 3.0.2-25
- Add patch to fix bug 1381767
- Clean up spec file with autosetup

Loading…
Cancel
Save