Add error checking for isEmailInCertificate being called with invalid fingerprint parameter.
This commit is contained in:
parent
05f1c81b60
commit
f1750eee8a
@ -456,14 +456,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 );
|
||||||
|
|
||||||
@ -511,7 +512,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