Re: [PATCH] checkout: check return value of resolve_refdup before using hash

2017-05-08 Thread Jeff King
On Sat, May 06, 2017 at 07:13:52PM +0200, René Scharfe wrote: > 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. > > Found with

[PATCH] checkout: check return value of resolve_refdup before using hash

2017-05-06 Thread René Scharfe
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. Found with t/t2011-checkout-invalid-head.sh --valgrind. Signed-off-by: Rene Scharfe