diff --git a/0001-coverity-return-const-string.patch b/0001-coverity-return-const-string.patch new file mode 100644 index 0000000..3c76fcb --- /dev/null +++ b/0001-coverity-return-const-string.patch @@ -0,0 +1,68 @@ +From 1f48b994ac987c20f8da2e4fa9ec0399877655c7 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Thu, 4 Sep 2014 16:48:00 +0200 +Subject: [PATCH] coverity: return const string& + +Otherwise the use in the C wrapper functions is invalid, as the +functions return char* from a string object that is destroyed in the +function scope. +--- + src/libcmis/oauth2-data.hxx | 12 ++++++------ + src/libcmis/rendition.hxx | 12 ++++++------ + 2 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/src/libcmis/oauth2-data.hxx b/src/libcmis/oauth2-data.hxx +index aa99e2c..000f939 100644 +--- a/src/libcmis/oauth2-data.hxx ++++ b/src/libcmis/oauth2-data.hxx +@@ -62,12 +62,12 @@ namespace libcmis + + bool isComplete(); + +- std::string getAuthUrl() { return m_authUrl; } +- std::string getTokenUrl() { return m_tokenUrl; } +- std::string getClientId() { return m_clientId; } +- std::string getClientSecret() { return m_clientSecret; } +- std::string getScope() { return m_scope; } +- std::string getRedirectUri() { return m_redirectUri; } ++ const std::string& getAuthUrl() { return m_authUrl; } ++ const std::string& getTokenUrl() { return m_tokenUrl; } ++ const std::string& getClientId() { return m_clientId; } ++ const std::string& getClientSecret() { return m_clientSecret; } ++ const std::string& getScope() { return m_scope; } ++ const std::string& getRedirectUri() { return m_redirectUri; } + }; + typedef ::boost::shared_ptr< OAuth2Data > OAuth2DataPtr; + } +diff --git a/src/libcmis/rendition.hxx b/src/libcmis/rendition.hxx +index 820b58d..c58b7ac 100644 +--- a/src/libcmis/rendition.hxx ++++ b/src/libcmis/rendition.hxx +@@ -65,18 +65,18 @@ namespace libcmis + + bool isThumbnail( ) { return m_kind == "cmis:thumbnail"; } + +- std::string getStreamId( ) const { return m_streamId; } +- std::string getMimeType( ) const { return m_mimeType; } +- std::string getKind( ) const { return m_kind; } +- std::string getUrl( ) const { return m_href; } +- std::string getTitle( ) const { return m_title; } ++ const std::string& getStreamId( ) const { return m_streamId; } ++ const std::string& getMimeType( ) const { return m_mimeType; } ++ const std::string& getKind( ) const { return m_kind; } ++ const std::string& getUrl( ) const { return m_href; } ++ const std::string& getTitle( ) const { return m_title; } + + /** Provides the stream length in bytes or a negative value if missing. + */ + long getLength( ) const { return m_length; } + long getWidth( ) const { return m_width; } + long getHeight( ) const { return m_height; } +- std::string getRenditionDocumentId( ) { return m_renditionDocumentId; } ++ const std::string& getRenditionDocumentId( ) { return m_renditionDocumentId; } + + std::string toString( ); + }; +-- +1.9.3 + diff --git a/libcmis.spec b/libcmis.spec index c1e72e6..5778d4b 100644 --- a/libcmis.spec +++ b/libcmis.spec @@ -2,7 +2,7 @@ Name: libcmis Version: 0.4.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A C++ client library for CM interfaces Group: System Environment/Libraries @@ -17,6 +17,7 @@ BuildRequires: pkgconfig(libxml-2.0) BuildRequires: xmlto Patch0: 0001-Fix-int-bool-confusion-on-big-endian-architectures.patch +Patch1: 0001-coverity-return-const-string.patch %description LibCMIS is a C++ client library for working with CM (content management) @@ -85,6 +86,9 @@ make check %{_mandir}/man1/cmis-client.1* %changelog +* Thu Sep 04 2014 David Tardon - 0.4.1-7 +- a few use-after-free fixes for the C wrapper + * Sun Aug 17 2014 Fedora Release Engineering - 0.4.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild