gpg-interface: avoid buffer overrun in parse_ssh_output()
commit65db97b4fa6b03059f2f14f313e07ca799d4ef3f
authorRené Scharfe <l.s.r@web.de>
Sat, 30 Oct 2021 17:07:38 +0000 (30 19:07 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Nov 2021 00:00:41 +0000 (1 17:00 -0700)
treebb94834a937d98134fc36d883220ad33c21874a6
parent18b18503e3b3721e0a513cbc83971a960e944c19
gpg-interface: avoid buffer overrun in parse_ssh_output()

If the string "key" we found in the output of ssh-keygen happens to be
located at the very end of the line, then going four characters further
leaves us beyond the end of the string.  Explicitly search for the
space after "key" to handle a missing one gracefully.

Signed-off-by: René Scharfe <l.s.r@web.de>
Acked-by: Fabian Stelzer <fs@gigacodes.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gpg-interface.c