summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-07-29 12:38:17 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-07-29 12:38:17 -0700
commitc5d81d7f5938909544e86d503d2c7cbc2f600e2f (patch)
tree9339e5e47ea9ec5b3d5cbec14443c0c783022d1c
parentMerge branch 'js/clean-report-too-long-a-path' into maint (diff)
parentgpg-interface: do not scan past the end of buffer (diff)
downloadtgif-c5d81d7f5938909544e86d503d2c7cbc2f600e2f.tar.xz
Merge branch 'sr/gpg-interface-stop-at-the-end' into maint
A codepath that reads from GPG for signed object verification read past the end of allocated buffer, which has been fixed. * sr/gpg-interface-stop-at-the-end: gpg-interface: do not scan past the end of buffer
-rw-r--r--gpg-interface.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gpg-interface.c b/gpg-interface.c
index 8ed274533f..d60115ca40 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -116,6 +116,9 @@ static void parse_gpg_output(struct signature_check *sigc)
for (line = buf; *line; line = strchrnul(line+1, '\n')) {
while (*line == '\n')
line++;
+ if (!*line)
+ break;
+
/* Skip lines that don't start with GNUPG status */
if (!skip_prefix(line, "[GNUPG:] ", &line))
continue;