Fix NULL pointer dereference

This commit is contained in:
Werner Koch 2007-01-31 15:22:21 +00:00
parent 10f654dfcd
commit 7759f3017e
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
2007-01-31 Werner Koch <wk@g10code.com> 2007-01-31 Werner Koch <wk@g10code.com>
* verify.c (verify_signatures): Do no dereference a NULL afx.
* passphrase.c (passphrase_get): Set the cancel flag on all error * passphrase.c (passphrase_get): Set the cancel flag on all error
from the agent. Fixes a bug reported by Tom Duerbusch. from the agent. Fixes a bug reported by Tom Duerbusch.

View File

@ -115,7 +115,7 @@ verify_signatures( int nfiles, char **files )
rc = proc_signature_packets( NULL, fp, sl, sigfile ); rc = proc_signature_packets( NULL, fp, sl, sigfile );
free_strlist(sl); free_strlist(sl);
iobuf_close(fp); iobuf_close(fp);
if( (afx->no_openpgp_data && rc == -1) || rc == G10ERR_NO_DATA ) { if( (afx && afx->no_openpgp_data && rc == -1) || rc == G10ERR_NO_DATA ) {
log_error(_("the signature could not be verified.\n" log_error(_("the signature could not be verified.\n"
"Please remember that the signature file (.sig or .asc)\n" "Please remember that the signature file (.sig or .asc)\n"
"should be the first file given on the command line.\n") ); "should be the first file given on the command line.\n") );