Hi,
There is a bug in 5.4.18 of Vpopmail where if you (as a programmer) call 
valias_select_all() twice in the same program on a domain that has no 
aliases, the second one (for me) gets a glibc double free error and 
aborts.
This occurs when using file based valias functions (vpalias.c).
You can get it to break by using vpopmaild and using list_alias on a 
domain with no aliases.
Patch attached.

Regards Drew
diff -uPr vpopmail-5.4.18.orig/vpalias.c vpopmail-5.4.18/vpalias.c
--- vpopmail-5.4.18.orig/vpalias.c      2006-12-19 21:02:47.000000000 +0000
+++ vpopmail-5.4.18/vpalias.c   2007-01-04 14:25:15.000000000 +0000
@@ -305,10 +305,13 @@
         }
       }
     }
-    if (num_names < max_names) {
+    if (num_names < max_names && num_names > 0) {
       new_names = realloc( names, num_names * sizeof(char *) );
       if (new_names != NULL)
        names = new_names;
+    } else if (num_names == 0) {
+      free(names);
+      names = NULL;
     }
 
     if (mydir!=NULL) {

Reply via email to