mirror of
https://github.com/git/git.git
synced 2026-01-11 02:32:58 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user