]> git.ipfire.org Git - thirdparty/git.git/commit - gpg-interface.c
gpg-interface: handle missing " with " gracefully in parse_ssh_output()
authorRené Scharfe <l.s.r@web.de>
Sat, 30 Oct 2021 17:04:56 +0000 (19:04 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Nov 2021 00:00:41 +0000 (17:00 -0700)
commit18b18503e3b3721e0a513cbc83971a960e944c19
tree9e42c9bec86dfb51d5c58e2c686b15c9318894ae
parent7e27bd589d328b9daf154c2444d1a86ec3afedb0
gpg-interface: handle missing " with " gracefully in parse_ssh_output()

If the output of ssh-keygen starts with "Good \"git\" signature for ",
but is not followed by " with " for some reason, then parse_ssh_output()
uses -1 as the len parameter of xmemdupz(), which in turn will end the
program.  Reject the signature and carry on instead in that case.

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