(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/imap/cmd-create.c) |
| |
| 7 | | | bool cmd_create(struct client_command_context *cmd) |
| 8 | | | { |
| 9 | | | struct mail_namespace *ns; |
| 10 | | | const char *mailbox, *full_mailbox; |
| 11 | | | bool directory; |
| 12 | | | size_t len; |
| 13 | | | |
| 14 | | | |
| 15 | [+] | | if (!client_read_string_args(cmd, 1, &mailbox)) |
 |
| 16 | | | return FALSE; |
| 17 | | | full_mailbox = mailbox; |
| 18 | | | |
| 19 | | | ns = client_find_namespace(cmd, &mailbox); |
| 20 | | | if (ns == NULL) |
Event 9:
Skipping " if". ns == (void *)0 evaluates to false.
hide
|
|
| 21 | | | return TRUE; |
| 22 | | | |
| 23 | | | len = strlen(full_mailbox); |
| 24 | | | if (len == 0 || full_mailbox[len-1] != ns->sep) |
| 25 | | | directory = FALSE; |
| 26 | | | else if (*mailbox == '\0') { |
| 27 | | | client_send_tagline(cmd, "NO Namespace already exists."); |
| 28 | | | return TRUE; |
| 29 | | | } else { |
| 30 | | | |
| 31 | | | |
| 32 | | | |
| 33 | | | directory = TRUE; |
| 34 | | | mailbox = t_strndup(mailbox, strlen(mailbox)-1); |
| 35 | | | full_mailbox = t_strndup(full_mailbox, len-1); |
| 36 | | | } |
| 37 | | | |
| 38 | | | if (!client_verify_mailbox_name(cmd, full_mailbox, |
| 39 | [+] | | CLIENT_VERIFY_MAILBOX_SHOULD_NOT_EXIST)) |
 |
| 40 | | | return TRUE; |
| 41 | | | |
| 42 | [+] | | if (mail_storage_mailbox_create(ns->storage, mailbox, directory) < 0) |
Event 21:
The resource of interest is allocated inside mail_storage_mailbox_create().
hide
|
|
 |
| |