From d8eea25b8b7becbfa3f059be6f5966a2f1aa7112 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 28 Jan 2015 20:12:21 +0100 Subject: gpg: Fix buffering problem in --list-config. * g10/gpg.c (list_config): Replace print_sanitized_string2 by es_write_sanitized. * common/stringhelp.c (print_sanitized_buffer2): Remove. (print_sanitized_buffer, print_sanitized_utf8_buffer): Remove. (print_sanitized_utf8_buffer, print_sanitized_utf8_string): Remove. (print_sanitized_string): Remove. * sm/certdump.c (print_dn_part, print_dn_parts): Remove arg FP. (pretty_print_sexp, gpgsm_print_name2, gpgsm_print_name): Remove. -- Mixing stdio and estream is never a good idea. This fix also allows us to remove a lot of garbage. Reported-by: Jason A. Donenfeld GnuPG-bug-id: 1822 Signed-off-by: Werner Koch --- g10/gpg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'g10') diff --git a/g10/gpg.c b/g10/gpg.c index 5e929d985..9a6b104c2 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -1599,7 +1599,8 @@ list_config(char *items) for(sl=iter->values;sl;sl=sl->next) { - print_sanitized_string2 (stdout, sl->d, ':',';'); + es_write_sanitized (es_stdout, sl->d, strlen (sl->d), + ":;", NULL); if(sl->next) es_printf(";"); } -- cgit v1.2.3