fix FTBFS

This commit is contained in:
David Tardon 2018-01-18 10:52:16 +01:00
parent c671cc74f4
commit 970abcb729
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,25 @@
From ff7ed27039693f91e8348495f3b909c23871123d Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 18 Jan 2018 10:42:04 +0100
Subject: [PATCH 1/2] do not try to use [] on an empty string
---
src/libcmis/ws-relatedmultipart.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libcmis/ws-relatedmultipart.cxx b/src/libcmis/ws-relatedmultipart.cxx
index 3b31634..675c274 100644
--- a/src/libcmis/ws-relatedmultipart.cxx
+++ b/src/libcmis/ws-relatedmultipart.cxx
@@ -169,7 +169,7 @@ RelatedMultipart::RelatedMultipart( const string& body, const string& contentTyp
if ( inHeaders )
{
// Remove potential \r at the end
- if ( line[line.length() - 1] == '\r' )
+ if ( !line.empty() && line[line.length() - 1] == '\r' )
line = line.substr( 0, line.length() - 1 );
if ( line.empty( ) )
--
2.14.3

View File

@ -0,0 +1,25 @@
From 738528d790b2b1d52d9b72d673842969a852815d Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 18 Jan 2018 10:48:52 +0100
Subject: [PATCH 2/2] return early if the time part is empty
---
src/libcmis/xml-utils.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libcmis/xml-utils.cxx b/src/libcmis/xml-utils.cxx
index d20ff47..6363af8 100644
--- a/src/libcmis/xml-utils.cxx
+++ b/src/libcmis/xml-utils.cxx
@@ -385,5 +385,8 @@ namespace libcmis
size_t teePos = dateTimeStr.find( 'T' );
+ if ( teePos == string::npos || teePos == dateTimeStr.size() - 1 )
+ return t; // obviously not a time
+
string noTzStr = dateTimeStr.substr( 0, teePos + 1 );
string timeStr = dateTimeStr.substr( teePos + 1 );
--
2.14.3

View File

@ -24,6 +24,8 @@ Patch3: 0004-Fix-test-in-test-gdrive.patch
Patch4: 0005-Fix-test-in-test-onedrive.patch
Patch5: 0001-update-boost.m4-to-fix-version-detection-with-gcc-6..patch
Patch6: 0001-rhbz-1410197-limit-the-number-of-redirections.patch
Patch7: 0001-do-not-try-to-use-on-an-empty-string.patch
Patch8: 0002-return-early-if-the-time-part-is-empty.patch
%description
LibCMIS is a C/C++ client library for working with CM (content management)