Add error checking for isEmailInCertificate being called with invalid fingerprint parameter.
This commit is contained in:
parent
29b7d7ad0b
commit
e5210c298a
@ -453,14 +453,15 @@ bool warnNoCertificate()
|
|||||||
|
|
||||||
bool isEmailInCertificate( const char* email, const char* fingerprint )
|
bool isEmailInCertificate( const char* email, const char* fingerprint )
|
||||||
{
|
{
|
||||||
|
bool bOk = false;
|
||||||
|
if( fingerprint ){
|
||||||
GpgmeCtx ctx;
|
GpgmeCtx ctx;
|
||||||
GpgmeError err;
|
GpgmeError err;
|
||||||
GpgmeKey rKey;
|
GpgmeKey rKey;
|
||||||
int UID_idx;
|
int UID_idx;
|
||||||
const char* attr_string;
|
const char* attr_string;
|
||||||
int emailCount = 0;
|
|
||||||
bool bOk = false;
|
|
||||||
int fprLen = strlen( fingerprint );
|
int fprLen = strlen( fingerprint );
|
||||||
|
int emailCount = 0;
|
||||||
|
|
||||||
fprintf( stderr, "gpgmeplug isEmailInCertificate looking for fingerprint %s\n", fingerprint );
|
fprintf( stderr, "gpgmeplug isEmailInCertificate looking for fingerprint %s\n", fingerprint );
|
||||||
|
|
||||||
@ -508,7 +509,9 @@ bool isEmailInCertificate( const char* email, const char* fingerprint )
|
|||||||
fprintf( stderr, "gpgmeplug isEmailInCertificate could NOT open KEYLIST for fingerprint %s\n", fingerprint );
|
fprintf( stderr, "gpgmeplug isEmailInCertificate could NOT open KEYLIST for fingerprint %s\n", fingerprint );
|
||||||
}
|
}
|
||||||
gpgme_release( ctx );
|
gpgme_release( ctx );
|
||||||
|
}else{
|
||||||
|
fprintf( stderr, "gpgmeplug isEmailInCertificate called with parameter FINGERPRINT being EMPTY\n" );
|
||||||
|
}
|
||||||
return bOk;
|
return bOk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user