Fix potential heap corruption in "gpg -v --version".
* g10/gpg.c (build_list): Rewrite to cope with buffer overflow in certain locales.
This fixes an obvious bug in locales where the translated string is
longer than the original. The bug could be exhibited by using
LANG=ru_RU.utf8 gpg -v --version.
En passant we also removed the trailing white space on continued
lines.
(cherry picked from commit 3402a84720e7d8c6ad04fc50eacb338a8ca05ca1)
- Reported-by: Dmitry V. Levin" <ldv at altlinux.org>
- Signed-off-by: Werner Koch <wk@gnupg.org>