diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-03 14:24:07 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-04 08:50:22 +0100 |
commit | 990b9d7acce2893d355a213b9a7855b2fb6f7b90 (patch) | |
tree | 3c01e8807d47e649d5bc2b3ea756f4282bd6592e | |
parent | d842ba65ec0c4e17a951570b0464afbfeac24dce (diff) |
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>
-rw-r--r-- | binaryurp/source/bridge.cxx | 2 | ||||
-rw-r--r-- | 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<sal_uInt8> aChaff(nLength); - rtl_random_getBytes(pool, aChaff.data(), nLength); + (void)rtl_random_getBytes(pool, aChaff.data(), nLength); rtl_random_destroyPool(pool); |