Kaydet (Commit) 0be1b5f4 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

coverity#982735 Negative loop bound

Change-Id: I597cd1204b0b7f5c7351482c3cdd00fc6111218a
Reviewed-on: https://gerrit.libreoffice.org/2224Reviewed-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
Tested-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
üst 975e2694
...@@ -690,7 +690,8 @@ Reference< XCertificate > SecurityEnvironment_NssImpl :: createCertificateFromRa ...@@ -690,7 +690,8 @@ Reference< XCertificate > SecurityEnvironment_NssImpl :: createCertificateFromRa
return xcert ; return xcert ;
} }
Reference< XCertificate > SecurityEnvironment_NssImpl :: createCertificateFromAscii( const OUString& asciiCertificate ) throw( SecurityException , RuntimeException ) { Reference< XCertificate > SecurityEnvironment_NssImpl :: createCertificateFromAscii( const OUString& asciiCertificate ) throw( SecurityException , RuntimeException )
{
xmlChar* chCert ; xmlChar* chCert ;
xmlSecSize certSize ; xmlSecSize certSize ;
...@@ -700,13 +701,20 @@ Reference< XCertificate > SecurityEnvironment_NssImpl :: createCertificateFromAs ...@@ -700,13 +701,20 @@ Reference< XCertificate > SecurityEnvironment_NssImpl :: createCertificateFromAs
certSize = xmlSecBase64Decode( chCert, ( xmlSecByte* )chCert, xmlStrlen( chCert ) ) ; certSize = xmlSecBase64Decode( chCert, ( xmlSecByte* )chCert, xmlStrlen( chCert ) ) ;
Sequence< sal_Int8 > rawCert( certSize ) ; if(certSize > 0)
for( unsigned int i = 0 ; i < certSize ; i ++ ) {
rawCert[i] = *( chCert + i ) ; Sequence< sal_Int8 > rawCert( certSize ) ;
for( unsigned int i = 0 ; i < certSize ; i ++ )
rawCert[i] = *( chCert + i ) ;
xmlFree( chCert ) ; xmlFree( chCert ) ;
return createCertificateFromRaw( rawCert ) ; return createCertificateFromRaw( rawCert ) ;
}
else
{
return NULL;
}
} }
sal_Int32 SecurityEnvironment_NssImpl :: sal_Int32 SecurityEnvironment_NssImpl ::
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment