1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
Since 2.6.12, mmap() on a zero-byte file will fail.
If you have unsubscribed users from a list, you might be left with zero-byte
subscriber list files, which will cause parsing the full subscriber to fail,
and mail will only be delivered to some subset of subscribers.
mlmmj-list uses similar logic, but would give a failure instead of counting the
subscribers properly.
Gentoo-BugID: 141904
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Date: Wed, 09 Jan 2008 08:25:04 +0000
diff -Nuar mlmmj-1.2.15.orig/src/getaddrsfromfd.c mlmmj-1.2.15/src/getaddrsfromfd.c
--- mlmmj-1.2.15.orig/src/getaddrsfromfd.c 2005-02-14 14:56:44.000000000 -0800
+++ mlmmj-1.2.15/src/getaddrsfromfd.c 2008-01-09 00:15:14.690251914 -0800
@@ -21,6 +21,10 @@
log_error(LOG_ARGS, "Could not fstat fd");
return -1;
}
+ /* mmap of 0-bytes is invalid */
+ if(st.st_size == 0) {
+ return 0;
+ }
start = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
if(start == MAP_FAILED) {
diff -Nuar mlmmj-1.2.15.orig/src/mlmmj-list.c mlmmj-1.2.15/src/mlmmj-list.c
--- mlmmj-1.2.15.orig/src/mlmmj-list.c 2004-11-28 10:46:43.000000000 -0800
+++ mlmmj-1.2.15/src/mlmmj-list.c 2008-01-09 00:16:12.719781510 -0800
@@ -68,6 +68,11 @@
if(!S_ISREG(st.st_mode))
return -1;
+
+ /* Nobody there */
+ if(st.st_size == 0) {
+ return 0;
+ }
start = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
if(start == MAP_FAILED)
|