(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/file-dotlock.c) |
| |
| 611 | | | static int file_dotlock_create_real(struct dotlock *dotlock, |
| 612 | | | enum dotlock_create_flags flags) |
| 613 | | | { |
| 614 | | | const char *lock_path; |
| 615 | | | struct stat st; |
| 616 | | | int fd, ret; |
| 617 | | | |
| 618 | [+] | | ret = dotlock_create(dotlock, flags, TRUE, &lock_path); |
Event 1:
!0 evaluates to true.
hide
Event 2:
&lock_path is passed to dotlock_create() as the fourth argument.
hide
|
|
 |
| 619 | | | if (ret <= 0 || (flags & DOTLOCK_CREATE_FLAG_CHECKONLY) != 0) |
Event 22:
Skipping " if". - ret <= 0 evaluates to false.
- (flags & DOTLOCK_CREATE_FLAG_CHECKONLY) != 0 evaluates to false.
hide
|
|
| 620 | | | return ret; |
| 621 | | | |
| 622 | | | fd = dotlock->fd; |
| 623 | | | dotlock->fd = -1; |
| 624 | | | |
| 625 | | | if (close(fd) < 0) { |
Event 23:
Skipping " if". close(fd) < 0 evaluates to false.
hide
|
|
| 626 | | | i_error("close(%s) failed: %m", lock_path); |
| 627 | | | return -1; |
| 628 | | | } |
| 629 | | | |
| 630 | | | |
| 631 | | | |
| 632 | | | |
| 633 | | | if (lstat(lock_path, &st) < 0) { |
Event 24:
lock_path, which evaluates to NULL, is passed to lstat64() as the first argument. See related event 9.
hide
Null Pointer Dereference
The body of lstat64() dereferences lock_path, but it is NULL. The issue can occur if the highlighted code executes. See related event 24. Show: All events | Only primary events |
|
| |