]> git.ipfire.org Git - thirdparty/git.git/commit
tree-walk: copy object ID before use
authorbrian m. carlson <sandals@crustytoothpaste.net>
Tue, 15 Jan 2019 00:39:41 +0000 (00:39 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Jan 2019 17:57:41 +0000 (09:57 -0800)
commit0a3faa45b1d35b227182166769357e0878da8f92
treefecb058078395271e6588f24869c1fd4252b2293
parentecbdaf0899161c067986e9d9d564586d4b045d62
tree-walk: copy object ID before use

In a future commit, the pointer returned by tree_entry_extract will
point into the struct tree_desc, causing its lifetime to be bound to
that of the struct tree_desc itself.  To ensure this code path keeps
working, copy the object_id into a local variable so that it lives long
enough.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tree-walk.c