summaryrefslogtreecommitdiffstats
path: root/package/source/zippackage/ZipPackageStream.cxx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:27:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:27:30 +0000
commita2baea7faff31d26459dab3668a39eae85e4991b (patch)
treeeaa2048ce9c715481f932dcfe20368e252b77d2f /package/source/zippackage/ZipPackageStream.cxx
parentAdding upstream version 4:24.2.0. (diff)
downloadlibreoffice-a2baea7faff31d26459dab3668a39eae85e4991b.tar.xz
libreoffice-a2baea7faff31d26459dab3668a39eae85e4991b.zip
Adding upstream version 4:24.2.1.upstream/4%24.2.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'package/source/zippackage/ZipPackageStream.cxx')
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index d3068a6665..a5d4a0f7ce 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -592,8 +592,14 @@ bool ZipPackageStream::saveChild(
uno::Sequence<sal_Int8> aSalt(16);
// note: for GCM it's particularly important that IV is unique
uno::Sequence<sal_Int8> aVector(GetIVSize());
- rtl_random_getBytes ( rRandomPool, aSalt.getArray(), 16 );
- rtl_random_getBytes ( rRandomPool, aVector.getArray(), aVector.getLength() );
+ if (rtl_random_getBytes(rRandomPool, aSalt.getArray(), 16) != rtl_Random_E_None)
+ {
+ throw uno::RuntimeException("rtl_random_getBytes failed");
+ }
+ if (rtl_random_getBytes(rRandomPool, aVector.getArray(), aVector.getLength()) != rtl_Random_E_None)
+ {
+ throw uno::RuntimeException("rtl_random_getBytes failed");
+ }
if ( !m_bHaveOwnKey )
{
m_aEncryptionKey = rEncryptionKey;