(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/deliver/deliver.c) |
| |
| 616 | | | static int deliver_create_dir(struct mail_user *user, const char *dir) |
| 617 | | | { |
| 618 | | | struct mail_namespace *ns; |
| 619 | | | const char *origin; |
| 620 | | | mode_t mode; |
| 621 | | | gid_t gid; |
| 622 | | | |
| 623 | | | ns = mail_namespace_find_inbox(user->namespaces); |
| 624 | | | if (ns == NULL) |
Redundant Condition
ns == (void *)0 always evaluates to false. This may be because: - There is a constant assignment to one or more of the variables involved.
- An earlier conditional statement has already ensured that ns == (void *)0 cannot be true.
- A crashing bug occurs on every path where ns == (void *)0 could have evaluated to true. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 625 | | | ns = user->namespaces; |
| 626 | | | |
| 627 | | | mailbox_list_get_dir_permissions(ns->list, NULL, &mode, &gid, &origin); |
| 628 | | | if (mkdir_parents_chgrp(dir, mode, gid, origin) == 0) { |
| 629 | | | return 0; |
| 630 | | | } else if (errno == EACCES) {
x /usr/include/asm-generic/errno-base.h |
| |
16 | #define EACCES 13 /* Permission denied */ |
| |
|
| 631 | | | i_error("%s", eacces_error_get_creating("mkdir_parents_chown", |
| 632 | | | dir)); |
| 633 | | | return -1; |
| 634 | | | } else { |
| 635 | | | i_error("mkdir_parents_chown(%s, gid=%s) failed: %m", |
| 636 | | | dir, dec2str(gid)); |
| 637 | | | return -1; |
| 638 | | | } |
| 639 | | | } |
| |