diff options
author | Werner Koch <[email protected]> | 2006-12-06 10:16:50 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2006-12-06 10:16:50 +0000 |
commit | 0173cd5a9810622e38b76123528e83024fb59a0c (patch) | |
tree | b8c52436a3d30842f2c59cfcf273a7934432321f /g10/export.c | |
parent | * keyedit.c (menu_clean): Show "already minimized" rather than (diff) | |
download | gnupg-0173cd5a9810622e38b76123528e83024fb59a0c.tar.gz gnupg-0173cd5a9810622e38b76123528e83024fb59a0c.zip |
Fixes for CVE-2006-6235
Diffstat (limited to 'g10/export.c')
-rw-r--r-- | g10/export.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/g10/export.c b/g10/export.c index afc7fd7f9..78def573d 100644 --- a/g10/export.c +++ b/g10/export.c @@ -137,10 +137,9 @@ do_export( strlist_t users, int secret, unsigned int options ) { IOBUF out = NULL; int any, rc; - armor_filter_context_t afx; + armor_filter_context_t *afx = NULL; compress_filter_context_t zfx; - memset( &afx, 0, sizeof afx); memset( &zfx, 0, sizeof zfx); rc = open_outfile( NULL, 0, &out ); @@ -151,8 +150,9 @@ do_export( strlist_t users, int secret, unsigned int options ) { if ( opt.armor ) { - afx.what = secret?5:1; - iobuf_push_filter ( out, armor_filter, &afx ); + afx = new_armor_context (); + afx->what = secret? 5 : 1; + push_armor_filter (afx, out); } if ( opt.compress_keys ) push_compress_filter (out,&zfx,default_compress_algo()); @@ -164,6 +164,7 @@ do_export( strlist_t users, int secret, unsigned int options ) iobuf_cancel (out); else iobuf_close (out); + release_armor_context (afx); return rc; } |