Skip to content

Commit

Permalink
Fix SIGSEGV on unmerged files in git-diff-files -p
Browse files Browse the repository at this point in the history
NULL is not considered a VALID pathspec.
  • Loading branch information
Linus Torvalds committed Jun 8, 2005
1 parent 7d95ee9 commit f9e7750
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diffcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
};
Expand Down

0 comments on commit f9e7750

Please sign in to comment.