diff -up gnupg-2.0.22/g10/mainproc.c.sanitize-filename gnupg-2.0.22/g10/mainproc.c
--- gnupg-2.0.22/g10/mainproc.c.sanitize-filename 2016-03-24 12:57:29.280170800 +0100
+++ gnupg-2.0.22/g10/mainproc.c 2018-06-21 13:42:53.448177540 +0200
@@ -631,7 +631,11 @@ proc_plaintext( CTX c, PACKET *pkt )
if( pt->namelen == 8 && !memcmp( pt->name, "_CONSOLE", 8 ) )
log_info(_("NOTE: sender requested \"for-your-eyes-only\"\n"));
else if( opt.verbose )
- log_info(_("original file name='%.*s'\n"), pt->namelen, pt->name);
+ {
+ char *tmp = make_printable_string (pt->name, pt->namelen, 0);
+ log_info (_("original file name='%.*s'\n"), (int)strlen (tmp), tmp);
+ xfree (tmp);
+ }
free_md_filter_context( &c->mfx );
if (gcry_md_open (&c->mfx.md, 0, 0))
BUG ();