parent
c671cc74f4
commit
970abcb729
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in new issue