notes: don't access hash of NULL object_id pointer
authorRené Scharfe <l.s.r@web.de>
Sat, 15 Jul 2017 18:15:26 +0000 (20:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Jul 2017 21:51:07 +0000 (14:51 -0700)
commit3ea6b85a871aa41eaa66a2919451ad12d492c355
treef99cc50988195a6385a961b1dabf0f502fbb8c55
parentfb04dced9c6510176f06953d2cd6a239703401f1
notes: don't access hash of NULL object_id pointer

Check if note is NULL, as we already do for different purposes a few
lines above, and pass a NULL pointer to prepare_note_data() in that
case instead of trying to access the hash member.

Found with Clang's UBSan.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Acked-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/notes.c