From 9a884b3d055ffdedbadb64c7f14e6d38078dedb1 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Wed, 28 Jun 2017 09:12:35 +0200 Subject: gpg4libre: Don't call production code inside an assert() Won't work in non-debug builds Change-Id: I64f9c416890ddd02ec8efc0f59ded145cc17896a Reviewed-on: https://gerrit.libreoffice.org/39345 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- xmlsecurity/source/gpg/CertificateImpl.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xmlsecurity/source/gpg/CertificateImpl.cxx') diff --git a/xmlsecurity/source/gpg/CertificateImpl.cxx b/xmlsecurity/source/gpg/CertificateImpl.cxx index 20fa35c52d5d..03fa49cdef68 100644 --- a/xmlsecurity/source/gpg/CertificateImpl.cxx +++ b/xmlsecurity/source/gpg/CertificateImpl.cxx @@ -217,14 +217,17 @@ void CertificateImpl::setCertificate(GpgME::Context* ctx, const GpgME::Key& key) if (err) throw RuntimeException("The GpgME library failed to retrieve the public key"); - assert(data_out.seek(0,SEEK_SET) == 0); + off_t result = data_out.seek(0,SEEK_SET); + (void) result; + assert(result == 0); int len=0, curr=0; char buf; while( (curr=data_out.read(&buf, 1)) ) len += curr; // write bits to sequence of bytes m_aBits.realloc(len); - assert(data_out.seek(0,SEEK_SET) == 0); + result = data_out.seek(0,SEEK_SET); + assert(result == 0); if( data_out.read(m_aBits.getArray(), len) != len ) throw RuntimeException("The GpgME library failed to read the key"); } -- cgit v1.2.3