[PATCH] am: 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. Signed-off-by: Rene Scharfe --- builtin/am.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

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

2017-05-08 Thread Jeff King
On Sat, May 06, 2017 at 07:13:56PM +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. > > Signed-off-by: Rene Sch