summaryrefslogtreecommitdiff
path: root/prio-queue.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-10-19 17:49:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-10-21 12:29:37 (GMT)
commitd79be4983bdf6598f106710a4826752a96f5dd58 (patch)
tree9ec7aaa5ff5ab93b5d32c6ecdcffbbad58df4191 /prio-queue.h
parent752848df0f18a9f8eb808a5b54c862c176d86e6d (diff)
downloadgit-d79be4983bdf6598f106710a4826752a96f5dd58.zip
git-d79be4983bdf6598f106710a4826752a96f5dd58.tar.gz
git-d79be4983bdf6598f106710a4826752a96f5dd58.tar.bz2
log: handle broken HEAD in decoration check
The resolve_ref_unsafe() function may return NULL even with a REF_ISSYMREF flag if a symref points to a broken ref. As a result, it's possible for the decoration code's "is this branch the current HEAD" check to segfault when it passes the NULL to starts_with(). This is unlikely in practice, since we can only reach this code if we already resolved HEAD to a matching sha1 earlier. But it's possible if HEAD racily becomes broken, or if there's a transient filesystem error. We can fix this by returning early in the broken case, since NULL could not possibly match any of our branch names. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'prio-queue.h')
0 files changed, 0 insertions, 0 deletions