Skip to content

Commit a70d782

Browse files
committed
Merge branch 'cb/compat-mmap-is-private-read-only'
Code tightening. * cb/compat-mmap-is-private-read-only: compat: make sure git_mmap is not expected to write
2 parents 87c15d1 + bf1e6da commit a70d782

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t of
44
{
55
size_t n = 0;
66

7-
if (start != NULL || !(flags & MAP_PRIVATE))
7+
if (start != NULL || flags != MAP_PRIVATE || prot != PROT_READ)
88
die("Invalid usage of mmap when built with NO_MMAP");
99

1010
start = xmalloc(length);

0 commit comments

Comments
 (0)