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:43:27 +0000 (20:43 +0200)
commit151b78cc26d728e9eb42620e0caf8c6f4bd7f839
treecd828d34c6fd5dc27b982f64b0426bec4407ec1f
parentd6798d261cbe6519ef5b3ebb474e2ad348442c0c
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 3402a84720e7d8c6ad04fc50eacb338a8ca05ca1)

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