Skip to content
Snippets Groups Projects
Commit 14763e7b authored by Eric Wong's avatar Eric Wong Committed by Junio C Hamano
Browse files

commit: fix a segfault when displaying a commit with unreachable parents


I was running git show on various commits found by fsck-objects
when I found this bug.  Since find_unique_abbrev() cannot find
an abbreviation for an object not in the database, it will
return NULL, which is bad to run strlen() on.  So instead, we'll
just display the unabbreviated sha1 that we referenced in the
commit.

I'm not sure that this is the best 'fix' for it because the
commit I was trying to show was broken, but I don't think a
program should segfault even if the user tries to do something
stupid.

Signed-off-by: default avatarEric Wong <normalperson@yhbt.net>
Signed-off-by: default avatarJunio C Hamano <junkio@cox.net>
parent b203b769
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment