summaryrefslogtreecommitdiff
path: root/diffcore.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-08 11:31:53 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-08 11:31:53 -0700
commitf9e7750621ca5e067f58a679caff5ff2f9881c4c (patch)
tree24dd7a6f14203f1be1e09b9731bb517689a6466c /diffcore.h
parent7d95ee935182a06374d152d7638bdd999e78f80b (diff)
downloadgit-f9e7750621ca5e067f58a679caff5ff2f9881c4c.tar.gz
Fix SIGSEGV on unmerged files in git-diff-files -p
NULL is not considered a VALID pathspec.
Diffstat (limited to 'diffcore.h')
-rw-r--r--diffcore.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/diffcore.h b/diffcore.h
index f1b5ca748c..ac159d7154 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 */
};