This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 4da39a13b5 tools: restore the SvMemoryStream::PutData bounds check
4da39a13b5 is described below

commit 4da39a13b5605cb7d178298540bb15b91584507d
Author: Jim Jagielski <[email protected]>
AuthorDate: Mon Nov 23 05:31:01 2026 -0500

    tools: restore the SvMemoryStream::PutData bounds check
    
    The Symphony VBA port (80d0876833) dropped it.
---
 main/tools/source/stream/stream.cxx | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/main/tools/source/stream/stream.cxx 
b/main/tools/source/stream/stream.cxx
index 6084f215b1..7481a912d7 100644
--- a/main/tools/source/stream/stream.cxx
+++ b/main/tools/source/stream/stream.cxx
@@ -2782,6 +2782,11 @@ sal_Size SvMemoryStream::PutData( const void* pData, 
sal_Size nCount )
             }
         }
     }
+    if (!pBuf || nCount > (nSize - nPos))
+    {
+        nCount = 0;
+        SetError( SVSTREAM_WRITE_ERROR );
+    }
     DBG_ASSERT(pBuf,"Possibly Reallocate failed");
     memcpy( pBuf+nPos, pData, (size_t)nCount);
 

Reply via email to