Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-10-30 09:43:49 +0300
committerJunio C Hamano <gitster@pobox.com>2018-10-30 09:43:49 +0300
commita70d7827ac071b9e4242ae7d145ce27013d8b928 (patch)
treece6d0d01173589783814af015b6c6c676cfc6d0a /compat
parent87c15d1ca969e978fb8d04bc486a28025d71e6b2 (diff)
parentbf1e6da79157ff765fc92b45ac96442b9f56ff8b (diff)
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
Diffstat (limited to 'compat')
-rw-r--r--compat/mmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compat/mmap.c b/compat/mmap.c
index 7f662fef7bc..14d31010dfe 100644
--- a/compat/mmap.c
+++ b/compat/mmap.c
@@ -4,7 +4,7 @@ void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t of
{
size_t n = 0;
- if (start != NULL || !(flags & MAP_PRIVATE))
+ if (start != NULL || flags != MAP_PRIVATE || prot != PROT_READ)
die("Invalid usage of mmap when built with NO_MMAP");
start = xmalloc(length);