(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/master/master-settings.c) |
| |
| 1651 | | | static void settings_dump(const struct setting_def *def, const void **sets, |
| 1652 | | | const char **set_names, unsigned int count, |
| 1653 | | | bool nondefaults, unsigned int indent) |
| 1654 | | | { |
| 1655 | | | const char **str; |
| 1656 | | | unsigned int i; |
| 1657 | | | |
| 1658 | [+] | | str = t_new(const char *, count);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/data-stack.h |
| |
75 | #define t_new(type, count) \ |
76 | ((type *) t_malloc0(sizeof(type) * (count))) |
| |
|
 |
| 1659 | | | for (; def->name != NULL; def++) { |
Event 22:
Entering loop body. def->name != (void *)0 evaluates to true.
hide
|
|
| 1660 | | | bool same = TRUE; |
Event 23:
!0 evaluates to true.
hide
|
|
| 1661 | | | |
| 1662 | | | switch (def->type) { |
Event 24:
def->type evaluates to implicit-default.
hide
|
|
| 1663 | | | case SET_STR: { |
| 1664 | | | const char *const *strp; |
| 1665 | | | |
| 1666 | | | for (i = 0; i < count; i++) { |
| 1667 | | | strp = CONST_PTR_OFFSET(sets[i], def->offset);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
29 | #define CONST_PTR_OFFSET(ptr, offset) \ |
30 | ((const void *) (((const unsigned char *) (ptr)) + (offset))) |
| |
|
| 1668 | | | str[i] = *strp != NULL ? *strp : ""; |
| 1669 | | | } |
| 1670 | | | break; |
| 1671 | | | } |
| 1672 | | | case SET_INT: { |
| 1673 | | | const unsigned int *n; |
| 1674 | | | |
| 1675 | | | for (i = 0; i < count; i++) { |
| 1676 | | | n = CONST_PTR_OFFSET(sets[i], def->offset);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
29 | #define CONST_PTR_OFFSET(ptr, offset) \ |
30 | ((const void *) (((const unsigned char *) (ptr)) + (offset))) |
| |
|
| 1677 | | | str[i] = dec2str(*n); |
| 1678 | | | } |
| 1679 | | | break; |
| 1680 | | | } |
| 1681 | | | case SET_BOOL: { |
| 1682 | | | const bool *b; |
| 1683 | | | |
| 1684 | | | for (i = 0; i < count; i++) { |
| 1685 | | | b = CONST_PTR_OFFSET(sets[i], def->offset);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
29 | #define CONST_PTR_OFFSET(ptr, offset) \ |
30 | ((const void *) (((const unsigned char *) (ptr)) + (offset))) |
| |
|
| 1686 | | | str[i] = *b ? "yes" : "no"; |
| 1687 | | | } |
| 1688 | | | break; |
| 1689 | | | } |
| 1690 | | | } |
| 1691 | | | |
| 1692 | | | for (i = 2; i < count; i++) { |
Event 25:
Leaving loop. i < count evaluates to false.
hide
|
|
| 1693 | | | if (strcmp(str[i], str[i-1]) != 0) |
| 1694 | | | same = FALSE; |
| 1695 | | | } |
| 1696 | | | if (same) { |
Event 26:
Taking true branch. same evaluates to true.
hide
|
|
| 1697 | | | if (!nondefaults || strcmp(str[0], str[1]) != 0) { |
Event 27:
Skipping " if". nondefaults evaluates to true.
hide
Event 28:
*str, which evaluates to NULL, is passed to strcmp() as the first argument. See related events 19 and 21.
hide
Null Pointer Dereference
The body of strcmp() dereferences str[0], but it is NULL. The issue can occur if the highlighted code executes. See related event 28. Show: All events | Only primary events |
|
| |