[cpp-xmltooling] branch main updated: CPPXT-161 - CurlInputStream should handle reallocation failures

Scott Cantor cantor.2 at osu.edu
Mon Sep 9 17:58:51 UTC 2024


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository cpp-xmltooling.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-xmltooling.git;a=commit;h=84392c1663598c4f8852b117abc1c7e132844811

The following commit(s) were added to refs/heads/main by this push:
     new 84392c1  CPPXT-161 - CurlInputStream should handle reallocation failures
84392c1 is described below

commit 84392c1663598c4f8852b117abc1c7e132844811
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Sep 9 13:58:08 2024 -0400

    CPPXT-161 - CurlInputStream should handle reallocation failures
    
    https://shibboleth.atlassian.net/browse/CPPXT-161
---
 xmltooling/util/CurlURLInputStream.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xmltooling/util/CurlURLInputStream.cpp b/xmltooling/util/CurlURLInputStream.cpp
index c55f66c..e92b559 100644
--- a/xmltooling/util/CurlURLInputStream.cpp
+++ b/xmltooling/util/CurlURLInputStream.cpp
@@ -479,6 +479,10 @@ size_t CurlURLInputStream::writeCallback(char* buffer, size_t size, size_t nitem
                 fBufferHeadPtr = newbuf + (fBufferHeadPtr - fBuffer);
                 fBuffer = fBufferTailPtr = newbuf;
             }
+            else {
+                // realloc failed, signal error back to libcurl
+                return 0;
+            }
         }
         memcpy(fBufferHeadPtr, buffer, cnt);
         fBufferHeadPtr  += cnt;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list