From 990b9d7acce2893d355a213b9a7855b2fb6f7b90 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 3 Feb 2024 14:24:07 +0000 Subject: cid#1591493 Unchecked return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0d39e142d3fd4100f68f1fff3f9d305aa1b59728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162954 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- binaryurp/source/bridge.cxx | 2 +- comphelper/source/xml/xmltools.cxx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx index 2bd3bcfb2f80..068649cc3b4b 100644 --- a/binaryurp/source/bridge.cxx +++ b/binaryurp/source/bridge.cxx @@ -75,7 +75,7 @@ namespace { sal_Int32 random() { sal_Int32 n; rtlRandomPool pool = rtl_random_createPool(); - rtl_random_getBytes(pool, &n, sizeof n); + (void)rtl_random_getBytes(pool, &n, sizeof n); rtl_random_destroyPool(pool); return n; } 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 aChaff(nLength); - rtl_random_getBytes(pool, aChaff.data(), nLength); + (void)rtl_random_getBytes(pool, aChaff.data(), nLength); rtl_random_destroyPool(pool); -- cgit