forked from pool/cmake
Accepting request 184170 from devel:tools:building
Fix a double free in destructor. OBS-URL: https://build.opensuse.org/request/show/184170 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cmake?expand=0&rev=68
This commit is contained in:
commit
fdae2afdde
76
cmake-cmCustomCommand_add_operator=.patch
Normal file
76
cmake-cmCustomCommand_add_operator=.patch
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
From 17c841c42d69987c84940232428928c39f1637cd Mon Sep 17 00:00:00 2001
|
||||||
|
From: Brad King <brad.king@kitware.com>
|
||||||
|
Date: Wed, 17 Jul 2013 11:02:46 -0400
|
||||||
|
Subject: [PATCH] add_custom_command: Manage backtrace memory correctly (#14299)
|
||||||
|
|
||||||
|
Add an assignment operator to cmCustomCommand to copy the Backtrace
|
||||||
|
member pointee and avoid multiple-free on destruction.
|
||||||
|
|
||||||
|
Reported-by: Vitezslav Cizek <vcizek@suse.cz>
|
||||||
|
---
|
||||||
|
Source/cmCustomCommand.cxx | 28 ++++++++++++++++++++++++++++
|
||||||
|
Source/cmCustomCommand.h | 1 +
|
||||||
|
2 files changed, 29 insertions(+), 0 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
|
||||||
|
index bd860ee..3620a38 100644
|
||||||
|
--- a/Source/cmCustomCommand.cxx
|
||||||
|
+++ b/Source/cmCustomCommand.cxx
|
||||||
|
@@ -13,6 +13,8 @@
|
||||||
|
|
||||||
|
#include "cmMakefile.h"
|
||||||
|
|
||||||
|
+#include <cmsys/auto_ptr.hxx>
|
||||||
|
+
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
cmCustomCommand::cmCustomCommand()
|
||||||
|
{
|
||||||
|
@@ -36,6 +38,32 @@ cmCustomCommand::cmCustomCommand(const cmCustomCommand& r):
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
+cmCustomCommand& cmCustomCommand::operator=(cmCustomCommand const& r)
|
||||||
|
+{
|
||||||
|
+ if(this == &r)
|
||||||
|
+ {
|
||||||
|
+ return *this;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ this->Outputs = r.Outputs;
|
||||||
|
+ this->Depends = r.Depends;
|
||||||
|
+ this->CommandLines = r.CommandLines;
|
||||||
|
+ this->HaveComment = r.HaveComment;
|
||||||
|
+ this->Comment = r.Comment;
|
||||||
|
+ this->WorkingDirectory = r.WorkingDirectory;
|
||||||
|
+ this->EscapeAllowMakeVars = r.EscapeAllowMakeVars;
|
||||||
|
+ this->EscapeOldStyle = r.EscapeOldStyle;
|
||||||
|
+ this->ImplicitDepends = r.ImplicitDepends;
|
||||||
|
+
|
||||||
|
+ cmsys::auto_ptr<cmListFileBacktrace>
|
||||||
|
+ newBacktrace(new cmListFileBacktrace(*r.Backtrace));
|
||||||
|
+ delete this->Backtrace;
|
||||||
|
+ this->Backtrace = newBacktrace.release();
|
||||||
|
+
|
||||||
|
+ return *this;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+//----------------------------------------------------------------------------
|
||||||
|
cmCustomCommand::cmCustomCommand(cmMakefile* mf,
|
||||||
|
const std::vector<std::string>& outputs,
|
||||||
|
const std::vector<std::string>& depends,
|
||||||
|
diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h
|
||||||
|
index dd92e34..e20d2bf 100644
|
||||||
|
--- a/Source/cmCustomCommand.h
|
||||||
|
+++ b/Source/cmCustomCommand.h
|
||||||
|
@@ -27,6 +27,7 @@ public:
|
||||||
|
/** Default and copy constructors for STL containers. */
|
||||||
|
cmCustomCommand();
|
||||||
|
cmCustomCommand(const cmCustomCommand& r);
|
||||||
|
+ cmCustomCommand& operator=(cmCustomCommand const& r);
|
||||||
|
|
||||||
|
/** Main constructor specifies all information for the command. */
|
||||||
|
cmCustomCommand(cmMakefile* mf,
|
||||||
|
--
|
||||||
|
1.7.0
|
||||||
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jul 17 11:49:37 UTC 2013 - vcizek@suse.com
|
||||||
|
|
||||||
|
- add missing operator= for cmCustomCommand (bnc#829544)
|
||||||
|
* cmake-cmCustomCommand_add_operator=.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Jun 20 19:17:35 UTC 2013 - tittiatcoke@gmail.com
|
Thu Jun 20 19:17:35 UTC 2013 - tittiatcoke@gmail.com
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ Source0: http://www.cmake.org/files/v2.8/%{name}-%{version}.tar.gz
|
|||||||
Patch1: cmake-disable-builtin-chrpath.diff
|
Patch1: cmake-disable-builtin-chrpath.diff
|
||||||
Patch2: cmake-fix-ruby-test.patch
|
Patch2: cmake-fix-ruby-test.patch
|
||||||
Patch3: cmake-fix-ImageMagick6.patch
|
Patch3: cmake-fix-ImageMagick6.patch
|
||||||
|
Patch4: cmake-cmCustomCommand_add_operator=.patch
|
||||||
Summary: Cross-platform, open-source make system
|
Summary: Cross-platform, open-source make system
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
Group: Development/Tools/Building
|
Group: Development/Tools/Building
|
||||||
@ -53,6 +54,7 @@ CMake is a cross-platform, open-source make system
|
|||||||
%patch1
|
%patch1
|
||||||
%patch2
|
%patch2
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
|
%patch4 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CXXFLAGS="$RPM_OPT_FLAGS"
|
export CXXFLAGS="$RPM_OPT_FLAGS"
|
||||||
|
Loading…
Reference in New Issue
Block a user