aboutsummaryrefslogtreecommitdiffstats
path: root/g10/plaintext.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2006-12-06 10:16:50 +0000
committerWerner Koch <[email protected]>2006-12-06 10:16:50 +0000
commit0173cd5a9810622e38b76123528e83024fb59a0c (patch)
treeb8c52436a3d30842f2c59cfcf273a7934432321f /g10/plaintext.c
parent* keyedit.c (menu_clean): Show "already minimized" rather than (diff)
downloadgnupg-0173cd5a9810622e38b76123528e83024fb59a0c.tar.gz
gnupg-0173cd5a9810622e38b76123528e83024fb59a0c.zip
Fixes for CVE-2006-6235
Diffstat (limited to 'g10/plaintext.c')
-rw-r--r--g10/plaintext.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c
index 2d516a3a5..cab4d6d46 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -449,18 +449,20 @@ int
ask_for_detached_datafile (gcry_md_hd_t md, gcry_md_hd_t md2,
const char *inname, int textmode )
{
- progress_filter_context_t pfx;
+ progress_filter_context_t *pfx;
char *answer = NULL;
IOBUF fp;
int rc = 0;
- fp = open_sigfile( inname, &pfx ); /* open default file */
+ pfx = new_progress_context ();
+ fp = open_sigfile ( inname, pfx ); /* Open default file. */
if( !fp && !opt.batch ) {
int any=0;
tty_printf(_("Detached signature.\n"));
do {
char *name;
+
xfree(answer);
tty_enable_completion(NULL);
name = cpr_get("detached_signature.filename",
@@ -505,6 +507,7 @@ ask_for_detached_datafile (gcry_md_hd_t md, gcry_md_hd_t md2,
leave:
xfree(answer);
+ release_progress_context (pfx);
return rc;
}
@@ -518,19 +521,23 @@ int
hash_datafiles( gcry_md_hd_t md, gcry_md_hd_t md2, strlist_t files,
const char *sigfilename, int textmode )
{
- progress_filter_context_t pfx;
+ progress_filter_context_t *pfx;
IOBUF fp;
strlist_t sl;
+ pfx = new_progress_context ();
+
if( !files ) {
/* check whether we can open the signed material */
- fp = open_sigfile( sigfilename, &pfx );
+ fp = open_sigfile( sigfilename, pfx );
if( fp ) {
do_hash( md, md2, fp, textmode );
iobuf_close(fp);
+ release_progress_context (pfx);
return 0;
}
log_error (_("no signed data\n"));
+ release_progress_context (pfx);
return gpg_error (GPG_ERR_NO_DATA);
}
@@ -547,13 +554,15 @@ hash_datafiles( gcry_md_hd_t md, gcry_md_hd_t md2, strlist_t files,
int rc = gpg_error_from_syserror ();
log_error(_("can't open signed data `%s'\n"),
print_fname_stdin(sl->d));
+ release_progress_context (pfx);
return rc;
}
- handle_progress (&pfx, fp, sl->d);
+ handle_progress (pfx, fp, sl->d);
do_hash( md, md2, fp, textmode );
iobuf_close(fp);
}
+ release_progress_context (pfx);
return 0;
}