From: Linus Torvalds Date: Wed, 8 Jun 2005 18:31:53 +0000 (-0700) Subject: Fix SIGSEGV on unmerged files in git-diff-files -p X-Git-Tag: v0.99~312 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=f9e7750621ca5e067f58a679caff5ff2f9881c4c;p=git.git Fix SIGSEGV on unmerged files in git-diff-files -p NULL is not considered a VALID pathspec. --- diff --git a/diffcore.h b/diffcore.h index f1b5ca74..ac159d71 100644 --- a/diffcore.h +++ b/diffcore.h @@ -33,7 +33,7 @@ struct diff_filespec { * if false, use the name and read from * the filesystem. */ -#define DIFF_FILE_VALID(spec) (((spec)->mode) != 0) +#define DIFF_FILE_VALID(spec) ((spec) && ((spec)->mode) != 0) unsigned should_free : 1; /* data should be free()'ed */ unsigned should_munmap : 1; /* data should be munmap()'ed */ };