(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/mail-namespace.c) |
| |
| 190 | | | int mail_namespaces_init(struct mail_user *user) |
| 191 | | | { |
| 192 | | | struct mail_namespace *namespaces, *ns, **ns_p; |
| 193 | | | enum mail_storage_flags flags; |
| 194 | | | enum file_lock_method lock_method; |
| 195 | | | const char *mail, *data, *error; |
| 196 | | | unsigned int i; |
| 197 | | | |
| 198 | | | mail_storage_parse_env(&flags, &lock_method); |
| 199 | | | namespaces = NULL; ns_p = &namespaces; |
| 200 | | | |
| 201 | | | |
| 202 | | | for (i = 1; ; i++) { |
| 203 | | | T_BEGIN {
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/data-stack.h |
| |
49 | #define T_BEGIN \ |
50 | STMT_START { unsigned int _data_stack_cur_id = t_push(); |
| |
|
| 204 | | | data = getenv(t_strdup_printf("NAMESPACE_%u", i)); |
| 205 | | | } T_END; |
| 206 | | | |
| 207 | | | if (data == NULL) |
Event 1:
Taking true branch. data == (void *)0 evaluates to true.
hide
|
|
| 208 | | | break; |
| 209 | | | |
| 210 | | | T_BEGIN {
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/data-stack.h |
| |
49 | #define T_BEGIN \ |
50 | STMT_START { unsigned int _data_stack_cur_id = t_push(); |
| |
|
| 211 | | | *ns_p = namespace_add_env(data, i, user, flags, |
| 212 | | | lock_method, namespaces); |
| 213 | | | } T_END; |
| 214 | | | |
| 215 | | | if (*ns_p == NULL) |
| 216 | | | return -1; |
| 217 | | | |
| 218 | | | ns_p = &(*ns_p)->next; |
| 219 | | | } |
| 220 | | | |
| 221 | | | if (namespaces != NULL) { |
Event 2:
Skipping " if". namespaces != (void *)0 evaluates to false.
hide
|
|
| 222 | | | if (!namespaces_check(namespaces)) { |
| 223 | | | while (namespaces != NULL) { |
| 224 | | | ns = namespaces; |
| 225 | | | namespaces = ns->next; |
| 226 | | | mail_namespace_free(ns); |
| 227 | | | } |
| 228 | | | return -1; |
| 229 | | | } |
| 230 | | | mail_user_add_namespace(user, &namespaces); |
| 231 | | | |
| 232 | | | if (hook_mail_namespaces_created != NULL) { |
| 233 | | | T_BEGIN {
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/data-stack.h |
| |
49 | #define T_BEGIN \ |
50 | STMT_START { unsigned int _data_stack_cur_id = t_push(); |
| |
|
| 234 | | | hook_mail_namespaces_created(namespaces); |
| 235 | | | } T_END; |
| 236 | | | } |
| 237 | | | return 0; |
| 238 | | | } |
| 239 | | | |
| 240 | | | |
| 241 | | | mail = getenv("MAIL"); |
| 242 | | | if (mail == NULL) { |
Event 3:
Skipping " if". mail == (void *)0 evaluates to false.
hide
|
|
| 243 | | | |
| 244 | | | mail = getenv("MAILDIR"); |
| 245 | | | if (mail != NULL) |
| 246 | | | mail = t_strconcat("maildir:", mail, NULL); |
| 247 | | | } |
| 248 | | | |
| 249 | | | ns = i_new(struct mail_namespace, 1);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/imem.h |
| |
8 | #define i_new(type, count) ((type *) i_malloc(sizeof(type) * (count))) |
| |
|
| 250 | | | ns->type = NAMESPACE_PRIVATE; |
| 251 | | | ns->flags = NAMESPACE_FLAG_INBOX | NAMESPACE_FLAG_LIST_PREFIX | |
| 252 | | | NAMESPACE_FLAG_SUBSCRIPTIONS; |
| 253 | | | ns->prefix = i_strdup(""); |
| 254 | | | ns->user = user; |
| 255 | | | ns->owner = user; |
| 256 | | | |
| 257 | | | if (mail_storage_create(ns, NULL, mail, flags, lock_method, |
| 258 | [+] | | &error) < 0) { |
Event 4:
&error is passed to mail_storage_create() as the sixth argument.
hide
Event 5:
mail_storage_create() does not initialize error. - This may be because of a failure case or other special case for mail_storage_create().
hide
|
|
 |
| |