summaryrefslogtreecommitdiffstats
path: root/xmlsecurity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-05-25 11:47:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-05-26 10:35:30 +0200
commit24b2c636a230c04ab4b9c6ed7d041f6420f959f1 (patch)
tree400edf162c26e51817c2ade75bbd259ae320d99f /xmlsecurity
parentMake helpcompiler more verbose on dot ahelps (diff)
downloadcore-24b2c636a230c04ab4b9c6ed7d041f6420f959f1.tar.gz
core-24b2c636a230c04ab4b9c6ed7d041f6420f959f1.zip
create SAL_RETURNS_NONNULL annotation
and apply it to some methods in OString and OUString Change-Id: I30e91f961b6d310799d3641f68b7ed54b3080f3a Reviewed-on: https://gerrit.libreoffice.org/38020 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/xmlsec/biginteger.cxx67
1 files changed, 31 insertions, 36 deletions
diff --git a/xmlsecurity/source/xmlsec/biginteger.cxx b/xmlsecurity/source/xmlsec/biginteger.cxx
index 4f1004be1a97..3981754cb776 100644
--- a/xmlsecurity/source/xmlsec/biginteger.cxx
+++ b/xmlsecurity/source/xmlsec/biginteger.cxx
@@ -29,53 +29,48 @@ namespace xmlsecurity
{
Sequence< sal_Int8 > numericStringToBigInteger ( const OUString& numeral )
{
- if( numeral.getStr() != nullptr )
- {
- xmlChar* chNumeral ;
- const xmlSecByte* bnInteger ;
- xmlSecSize length ;
- xmlSecBn bn ;
+ xmlChar* chNumeral ;
+ const xmlSecByte* bnInteger ;
+ xmlSecSize length ;
+ xmlSecBn bn ;
- OString onumeral = OUStringToOString( numeral , RTL_TEXTENCODING_ASCII_US ) ;
+ OString onumeral = OUStringToOString( numeral , RTL_TEXTENCODING_ASCII_US ) ;
- chNumeral = xmlStrndup( reinterpret_cast<const xmlChar*>(onumeral.getStr()), ( int )onumeral.getLength() ) ;
-
- if( xmlSecBnInitialize( &bn, 0 ) < 0 ) {
- xmlFree( chNumeral ) ;
- return Sequence< sal_Int8 >();
- }
-
- if( xmlSecBnFromDecString( &bn, chNumeral ) < 0 ) {
- xmlFree( chNumeral ) ;
- xmlSecBnFinalize( &bn ) ;
- return Sequence< sal_Int8 >();
- }
+ chNumeral = xmlStrndup( reinterpret_cast<const xmlChar*>(onumeral.getStr()), ( int )onumeral.getLength() ) ;
+ if( xmlSecBnInitialize( &bn, 0 ) < 0 ) {
xmlFree( chNumeral ) ;
+ return Sequence< sal_Int8 >();
+ }
- length = xmlSecBnGetSize( &bn ) ;
- if( length <= 0 ) {
- xmlSecBnFinalize( &bn ) ;
- return Sequence< sal_Int8 >();
- }
+ if( xmlSecBnFromDecString( &bn, chNumeral ) < 0 ) {
+ xmlFree( chNumeral ) ;
+ xmlSecBnFinalize( &bn ) ;
+ return Sequence< sal_Int8 >();
+ }
- bnInteger = xmlSecBnGetData( &bn ) ;
- if( bnInteger == nullptr ) {
- xmlSecBnFinalize( &bn ) ;
- return Sequence< sal_Int8 >();
- }
+ xmlFree( chNumeral ) ;
- Sequence< sal_Int8 > integer( length ) ;
- for( xmlSecSize i = 0 ; i < length ; i ++ )
- {
- integer[i] = *( bnInteger + i ) ;
- }
+ length = xmlSecBnGetSize( &bn ) ;
+ if( length <= 0 ) {
+ xmlSecBnFinalize( &bn ) ;
+ return Sequence< sal_Int8 >();
+ }
+ bnInteger = xmlSecBnGetData( &bn ) ;
+ if( bnInteger == nullptr ) {
xmlSecBnFinalize( &bn ) ;
- return integer ;
+ return Sequence< sal_Int8 >();
+ }
+
+ Sequence< sal_Int8 > integer( length ) ;
+ for( xmlSecSize i = 0 ; i < length ; i ++ )
+ {
+ integer[i] = *( bnInteger + i ) ;
}
- return Sequence< sal_Int8 >();
+ xmlSecBnFinalize( &bn ) ;
+ return integer ;
}
OUString bigIntegerToNumericString ( const Sequence< sal_Int8 >& integer )