all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 580af8781a3ce19f4e6c4a47ba50881aeb3db8dc 875 bytes (raw)
name: gnu/packages/patches/libgit2-use-after-free.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
This patch is taken from <https://github.com/libgit2/libgit2/pull/4122>;
we need it to fix the use-after-free error in 'git_commit_extract_signature'
reported at <https://github.com/libgit2/libgit2/issues/4118>.

From ade0d9c658fdfc68d8046935f6908f033fe7a529 Mon Sep 17 00:00:00 2001
From: Patrick Steinhardt <ps@pks.im>
Date: Mon, 13 Feb 2017 13:46:17 +0100
Subject: [PATCH 3/3] commit: avoid possible use-after-free

diff --git a/src/commit.c b/src/commit.c
index 89a4db1..05b70a9 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -766,8 +766,9 @@ int git_commit_extract_signature(git_buf *signature, git_buf *signed_data, git_r
 		if (git_buf_oom(signature))
 			goto oom;
 
+		error = git_buf_puts(signed_data, eol+1);
 		git_odb_object_free(obj);
-		return git_buf_puts(signed_data, eol+1);
+		return error;
 	}
 
 	giterr_set(GITERR_OBJECT, "this commit is not signed");

debug log:

solving 580af8781 ...
found 580af8781 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.