Commit 3210a3a4 3210a3a4fd9f5bf52f702435abe05d157894b627 by Sergey Poznyakoff

(mu_auth_virt_domain_by_name): Bugfix. Didn't allocate enough storage for mailbox_name.

1 parent c0106c92
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
52 #include <mailutils/argp.h> 52 #include <mailutils/argp.h>
53 #include <mailutils/mu_auth.h> 53 #include <mailutils/mu_auth.h>
54 54
55 #ifdef USE_VIRTUAL_DOMAINS 55 #ifdef ENABLE_VIRTUAL_DOMAINS
56 56
57 static char *site_virtual_pwddir = SITE_VIRTUAL_PWDDIR; 57 static char *site_virtual_pwddir = SITE_VIRTUAL_PWDDIR;
58 58
...@@ -154,7 +154,7 @@ mu_auth_virt_domain_by_name (void *return_data, void *key, ...@@ -154,7 +154,7 @@ mu_auth_virt_domain_by_name (void *return_data, void *key,
154 return 1; 154 return 1;
155 } 155 }
156 156
157 mailbox_name = calloc (strlen (pw->pw_dir) + strlen ("/INBOX"), 1); 157 mailbox_name = calloc (strlen (pw->pw_dir) + strlen ("/INBOX") + 1, 1);
158 sprintf (mailbox_name, "%s/INBOX", pw->pw_dir); 158 sprintf (mailbox_name, "%s/INBOX", pw->pw_dir);
159 159
160 rc = mu_auth_data_alloc ((struct mu_auth_data **) return_data, 160 rc = mu_auth_data_alloc ((struct mu_auth_data **) return_data,
...@@ -211,7 +211,7 @@ mu_auth_virt_domain_by_name (void *return_data, void *key, ...@@ -211,7 +211,7 @@ mu_auth_virt_domain_by_name (void *return_data, void *key,
211 211
212 struct mu_auth_module mu_auth_virtual_module = { 212 struct mu_auth_module mu_auth_virtual_module = {
213 "virtdomain", 213 "virtdomain",
214 #ifdef USE_VIRTUAL_DOMAINS 214 #ifdef ENABLE_VIRTUAL_DOMAINS
215 &mu_virt_argp, 215 &mu_virt_argp,
216 #else 216 #else
217 NULL, 217 NULL,
......