summaryrefslogtreecommitdiff
path: root/unoidl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-10 11:23:51 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-10 14:03:32 +0000
commit775bf0c7d973226cad13c0e54ad384ae4e905041 (patch)
treeb390abdd03354df1800ea85c167e8ba2a8c4b16c /unoidl
parentf9b32576553b2972194510cc808d12fe198bc8c8 (diff)
test coverity sanitizing in-source modelling
Change-Id: I31b1f021c414b26372c07a28c235bedb3e5a2b32
Diffstat (limited to 'unoidl')
-rw-r--r--unoidl/source/unoidlprovider.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/unoidl/source/unoidlprovider.cxx b/unoidl/source/unoidlprovider.cxx
index ea15ff5a119a..47e59bfc82db 100644
--- a/unoidl/source/unoidlprovider.cxx
+++ b/unoidl/source/unoidlprovider.cxx
@@ -531,6 +531,10 @@ sal_uInt32 findInMap(
return off;
}
+#if defined(__COVERITY__)
+extern "C" void __coverity_tainted_data_sanitize__(void *);
+#endif
+
std::vector< OUString > readAnnotations(
bool annotated, rtl::Reference< MappedFile > const & file,
sal_uInt32 offset, sal_uInt32 * newOffset = nullptr)
@@ -538,6 +542,9 @@ std::vector< OUString > readAnnotations(
std::vector< OUString > ans;
if (annotated) {
sal_uInt32 n = file->read32(offset);
+#if defined(__COVERITY__)
+ __coverity_tainted_data_sanitize__(&n);
+#endif
offset += 4;
for (sal_uInt32 i = 0; i != n; ++i) {
ans.push_back(file->readIdxString(&offset));