(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/imap/cmd-subscribe.c) |
| |
| 29 | | | bool cmd_subscribe_full(struct client_command_context *cmd, bool subscribe) |
| 30 | | | { |
| 31 | | | struct mail_namespace *ns, *real_ns; |
| 32 | | | struct mail_storage *storage; |
| 33 | | | const char *mailbox, *verify_name, *real_name; |
| 34 | | | |
| 35 | | | |
| 36 | [+] | | if (!client_read_string_args(cmd, 1, &mailbox)) |
 |
| 37 | | | return FALSE; |
| 38 | | | verify_name = mailbox; |
| 39 | | | |
| 40 | | | real_name = mailbox; |
| 41 | [+] | | storage = client_find_storage(cmd, &real_name); |
 |
| 42 | | | if (storage == NULL) |
Event 15:
Skipping " if". storage == (void *)0 evaluates to false.
hide
|
|
| 43 | | | return TRUE; |
| 44 | | | |
| 45 | | | |
| 46 | | | ns = mail_namespace_find_subscribable(cmd->client->user->namespaces, |
| 47 | [+] | | &mailbox); |
 |
| 48 | | | if (ns == NULL) { |
Event 20:
Skipping " if". ns == (void *)0 evaluates to false.
hide
|
|
| 49 | | | client_send_tagline(cmd, "NO Unknown subscription namespace."); |
| 50 | | | return TRUE; |
| 51 | | | } |
| 52 | | | |
| 53 | | | real_ns = mail_storage_get_namespace(storage); |
| 54 | | | if (ns != real_ns) { |
Event 21:
Taking true branch. ns != real_ns evaluates to true.
hide
|
|
| 55 | | | |
| 56 | | | |
| 57 | [+] | | mailbox = t_strconcat(real_ns->prefix, real_name, NULL); |
 |
| 58 | | | |
| 59 | | | i_assert(strncmp(ns->prefix, mailbox, strlen(ns->prefix)) == 0);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
189 | #define i_assert(expr) STMT_START{ \ |
190 | if (unlikely(!(expr))) \ |
191 | i_panic("file %s: line %d (%s): assertion failed: (%s)", \ |
192 | __FILE__, \ |
193 | __LINE__, \ |
194 | __PRETTY_FUNCTION__, \ |
195 | #expr); }STMT_END |
| |
|
Event 28:
mailbox, which evaluates to NULL, is passed to strncmp() as the second argument. See related event 27.
hide
Null Pointer Dereference
The body of strncmp() dereferences mailbox, but it is NULL. The issue can occur if the highlighted code executes. See related event 28. Show: All events | Only primary events |
|
| |