Fix potential heap corruption in "gpg -v --version".
authorWerner Koch <wk@gnupg.org>
Sat, 15 Dec 2012 10:28:00 +0000 (11:28 +0100)
committerWerner Koch <wk@gnupg.org>
Mon, 22 Apr 2013 18:25:35 +0000 (20:25 +0200)
commit3402a84720e7d8c6ad04fc50eacb338a8ca05ca1
tree1c734c0316ef04b29c822efbb0c6954ea5b7d7b4
parent7db5c81e3a40b60e146f29c6744a33fd1b88c090
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.

Reported-by: Dmitry V. Levin" <ldv at altlinux.org>
(cherry picked from commit e33e74e3a4b2b4a0341f933410ddd5db7a12515e)

Note that this version uses utf8_charcount to get the indentation
mostly right.

Signed-off-by: Werner Koch <wk@gnupg.org>
g10/gpg.c