From adb203bc05e3e36173cbd46b9951f79821a81799 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 11:27:54 +0200 Subject: Merging upstream version 4:24.2.1. Signed-off-by: Daniel Baumann --- package/source/zippackage/ZipPackageStream.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'package/source/zippackage/ZipPackageStream.cxx') 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 aSalt(16); // note: for GCM it's particularly important that IV is unique uno::Sequence 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; -- cgit v1.2.3