commit | 5b8eb2d83867c0fd70a65e8090649fbd6b58b31b | [log] [tgz] |
---|---|---|
author | Bertho Stultiens <bertho@panter.soci.aau.dk> | Wed May 03 17:35:10 2000 +0000 |
committer | Alexandre Julliard <julliard@winehq.org> | Wed May 03 17:35:10 2000 +0000 |
tree | 4a40e9f4e227d7bf6060b71e3d0a1a902e1d38e0 | |
parent | 72eb8d39d40ac20e794dc9154b25284c7edf54d8 [diff] [blame] |
Mmap does not fail on zero-length files.
diff --git a/misc/registry.c b/misc/registry.c index 1d62ca4..684eff5 100644 --- a/misc/registry.c +++ b/misc/registry.c
@@ -1063,6 +1063,7 @@ /* map the registry into the memory */ if ((fd = open(full_name.long_name, O_RDONLY | O_NONBLOCK)) == -1) return FALSE; if ((fstat(fd, &st) == -1)) goto error; + if (!st.st_size) goto error; if ((base = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) goto error; switch (*(LPDWORD)base)