]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/am.c
am: check return value of resolve_refdup before using hash
authorRené Scharfe <l.s.r@web.de>
Sat, 6 May 2017 17:13:56 +0000 (19:13 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 May 2017 02:12:42 +0000 (11:12 +0900)
commit57e0ef0e0e90c4cb72c35db874fc3d035b88ce4d
tree5d18c963265442be4c33623c6cafdd9b9013fd56
parent79e913c24aa37d0ede9ed9e8962a19634ae5129a
am: check return value of resolve_refdup before using hash

If resolve_refdup() fails it returns NULL and possibly leaves its hash
output parameter untouched.  Make sure to use it only if the function
succeeded, in order to avoid accessing uninitialized memory.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c