summaryrefslogtreecommitdiffstats
path: root/comphelper
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-03 14:24:07 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-04 08:50:22 +0100
commit990b9d7acce2893d355a213b9a7855b2fb6f7b90 (patch)
tree3c01e8807d47e649d5bc2b3ea756f4282bd6592e /comphelper
parentcid#1591495 Resource leak (diff)
downloadcore-990b9d7acce2893d355a213b9a7855b2fb6f7b90.tar.gz
core-990b9d7acce2893d355a213b9a7855b2fb6f7b90.zip
cid#1591493 Unchecked return value
Change-Id: I0d39e142d3fd4100f68f1fff3f9d305aa1b59728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162954 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/xml/xmltools.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/comphelper/source/xml/xmltools.cxx b/comphelper/source/xml/xmltools.cxx
index 1b10964b1a35..6ae8fceed5b9 100644
--- a/comphelper/source/xml/xmltools.cxx
+++ b/comphelper/source/xml/xmltools.cxx
@@ -71,17 +71,21 @@ namespace
namespace comphelper::xml
{
+ // Generate some 'chaff' of varying length to be the body of an
+ // XML comment to put at the start of encrypted content to make
+ // document content a little less predictable.
+ // See SvXMLExport::addChaffWhenEncryptedStorage
OString makeXMLChaff()
{
rtlRandomPool pool = rtl_random_createPool();
sal_Int8 n;
- rtl_random_getBytes(pool, &n, 1);
+ (void)rtl_random_getBytes(pool, &n, 1);
sal_Int32 nLength = 1024+n;
// coverity[tainted_data] - 1024 deliberate random minus max -127/plus max 128
std::vector<sal_uInt8> aChaff(nLength);
- rtl_random_getBytes(pool, aChaff.data(), nLength);
+ (void)rtl_random_getBytes(pool, aChaff.data(), nLength);
rtl_random_destroyPool(pool);