(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-storage.c) |
| |
| 769 | | | maildir_list_delete_mailbox(struct mailbox_list *list, const char *name) |
| 770 | | | { |
| 771 | | | struct maildir_storage *storage = MAILDIR_LIST_CONTEXT(list);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/module-context.h |
| |
46 | #define MODULE_CONTEXT(obj, id_ctx) \ |
47 | (*((void **)array_idx_modifiable(&(obj)->module_contexts, \ |
48 | (id_ctx).id.module_id) + \ |
49 | OBJ_REGISTER_COMPATIBLE(obj, id_ctx))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
179 | #define array_idx_modifiable(array, idx) \ |
180 | ARRAY_TYPE_CAST_MODIFIABLE(array) \ |
181 | array_idx_modifiable_i(&(array)->arr, idx) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
45 | # define ARRAY_TYPE_CAST_MODIFIABLE(array) \ |
46 | (typeof(*(array)->v_modifiable)) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/module-context.h |
| |
43 | #define OBJ_REGISTER_COMPATIBLE(obj, id_ctx) \ |
44 | COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(OBJ_REGISTER(obj), (id_ctx).reg) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
158 | # define COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(_a, _b) \ |
159 | COMPILE_ERROR_IF_TRUE( \ |
160 | !__builtin_types_compatible_p(typeof(_a), typeof(_b))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
156 | # define COMPILE_ERROR_IF_TRUE(condition) \ |
157 | (sizeof(char[1 - 2 * !!(condition)]) - 1) |
| |
|
| 772 | | | struct stat st; |
| 773 | | | const char *src, *dest, *base; |
| 774 | | | int count; |
| 775 | | | |
| 776 | | | |
| 777 | | | |
| 778 | | | |
| 779 | | | |
| 780 | | | index_storage_destroy_unrefed(); |
| 781 | | | |
| 782 | | | |
| 783 | | | if (storage->list_module_ctx.super.delete_mailbox(list, name) < 0) |
Event 1:
Skipping " if". storage->list_module_ctx.super.delete_mailbox(...) < 0 evaluates to false.
hide
|
|
| 784 | | | return -1; |
| 785 | | | |
| 786 | | | |
| 787 | | | src = mailbox_list_get_path(list, name, MAILBOX_LIST_PATH_TYPE_MAILBOX); |
| 788 | | | if (lstat(src, &st) != 0 && errno == ENOENT) {
x /usr/include/asm-generic/errno-base.h |
| |
5 | #define ENOENT 2 /* No such file or directory */ |
| |
|
Event 2:
Skipping " if". lstat(src, &st) != 0 evaluates to false.
hide
|
|
| 789 | | | mailbox_list_set_error(list, MAIL_ERROR_NOTFOUND, |
| 790 | | | T_MAIL_ERR_MAILBOX_NOT_FOUND(name));
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/mail-error.h |
| |
19 | #define T_MAIL_ERR_MAILBOX_NOT_FOUND(name) \ |
20 | t_strdup_printf(MAIL_ERRSTR_MAILBOX_NOT_FOUND, name) |
| |
|
| 791 | | | return -1; |
| 792 | | | } |
| 793 | | | |
| 794 | | | if (!S_ISDIR(st.st_mode)) {
x /usr/include/sys/stat.h |
| |
131 | #define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR) |
| |
x /usr/include/sys/stat.h |
| |
129 | #define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask)) |
| |
x /usr/include/bits/stat.h |
| |
182 | #define __S_IFMT 0170000 /* These bits determine file type. */ |
| |
x /usr/include/bits/stat.h |
| |
185 | #define __S_IFDIR 0040000 /* Directory. */ |
| |
|
Event 3:
Skipping " if". (st.st_mode & 61440) == 16384 evaluates to true.
hide
|
|
| 795 | | | |
| 796 | | | if (unlink(src) < 0 && errno != ENOENT) {
x /usr/include/asm-generic/errno-base.h |
| |
5 | #define ENOENT 2 /* No such file or directory */ |
| |
|
| 797 | | | mailbox_list_set_critical(list, |
| 798 | | | "unlink(%s) failed: %m", src); |
| 799 | | | return -1; |
| 800 | | | } |
| 801 | | | return 0; |
| 802 | | | } |
| 803 | | | |
| 804 | | | if (strcmp(name, "INBOX") == 0) { |
Event 4:
Skipping " if". strcmp(name, "INBOX") == 0 evaluates to false.
hide
|
|
| 805 | | | |
| 806 | | | |
| 807 | | | |
| 808 | | | |
| 809 | | | base = mailbox_list_get_path(list, NULL, |
| 810 | | | MAILBOX_LIST_PATH_TYPE_MAILBOX); |
| 811 | | | if (strcmp(base, src) == 0) { |
| 812 | | | mailbox_list_set_error(list, MAIL_ERROR_NOTPOSSIBLE, |
| 813 | | | "INBOX can't be deleted."); |
| 814 | | | return -1; |
| 815 | | | } |
| 816 | | | } |
| 817 | | | |
| 818 | [+] | | dest = maildir_get_unlink_dest(list, name); |
 |
| 819 | | | if (dest == NULL) { |
Event 39:
Skipping " if". dest == (void *)0 evaluates to false.
hide
|
|
| 820 | | | |
| 821 | | | return maildir_delete_nonrecursive(list, src, name); |
| 822 | | | } |
| 823 | | | |
| 824 | | | |
| 825 | | | |
| 826 | | | |
| 827 | | | |
| 828 | | | count = 0; |
| 829 | | | while (rename(src, dest) < 0) { |
Event 40:
dest, which evaluates to the value assigned to ret at data-stack.c:335, is passed to rename() as the second argument. See related event 38.
hide
Event 41:
rename() accesses the file named dest, where dest is the value assigned to ret at data-stack.c:335. - The same name is used to access a file later, but it is not safe to assume that it will be the same underlying file.
See related event 40.
hide
Event 42:
Leaving loop. rename(src, dest) < 0 evaluates to false.
hide
|
|
| 830 | | | if (errno == ENOENT) {
x /usr/include/asm-generic/errno-base.h |
| |
5 | #define ENOENT 2 /* No such file or directory */ |
| |
|
| 831 | | | |
| 832 | | | |
| 833 | | | mailbox_list_set_error(list, MAIL_ERROR_NOTFOUND, |
| 834 | | | T_MAIL_ERR_MAILBOX_NOT_FOUND(name));
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/mail-error.h |
| |
19 | #define T_MAIL_ERR_MAILBOX_NOT_FOUND(name) \ |
20 | t_strdup_printf(MAIL_ERRSTR_MAILBOX_NOT_FOUND, name) |
| |
|
| 835 | | | return -1; |
| 836 | | | } |
| 837 | | | if (!EDESTDIREXISTS(errno)) {
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/compat.h |
| |
253 | #define EDESTDIREXISTS(errno) \ |
254 | ((errno) == EEXIST || (errno) == ENOTEMPTY || (errno) == EBUSY) |
| |
x /usr/include/asm-generic/errno.h |
| |
10 | #define ENOTEMPTY 39 /* Directory not empty */ |
| |
x /usr/include/asm-generic/errno-base.h |
| |
19 | #define EBUSY 16 /* Device or resource busy */ |
| |
|
| 838 | | | mailbox_list_set_critical(list, |
| 839 | | | "rename(%s, %s) failed: %m", src, dest); |
| 840 | | | return -1; |
| 841 | | | } |
| 842 | | | |
| 843 | | | |
| 844 | | | if (unlink_directory(dest, TRUE) < 0 && |
| 845 | | | (errno != ENOTEMPTY || count >= 5)) {
x /usr/include/asm-generic/errno.h |
| |
10 | #define ENOTEMPTY 39 /* Directory not empty */ |
| |
|
| 846 | | | mailbox_list_set_critical(list, |
| 847 | | | "unlink_directory(%s) failed: %m", dest); |
| 848 | | | return -1; |
| 849 | | | } |
| 850 | | | count++; |
| 851 | | | } |
| 852 | | | |
| 853 | [+] | | if (unlink_directory(dest, TRUE) < 0 && errno != ENOTEMPTY) {
x /usr/include/asm-generic/errno.h |
| |
10 | #define ENOTEMPTY 39 /* Directory not empty */ |
| |
|
Event 43:
Skipping " if". !0 evaluates to true.
hide
Event 44:
dest, which evaluates to the value assigned to ret at data-stack.c:335, is passed to unlink_directory() as the first argument. See related event 38.
hide
|
|
 |
| |