(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/unix-socket-create.c) |
| |
| 10 | | | int unix_socket_create(const char *path, int mode, |
| 11 | | | uid_t uid, gid_t gid, int backlog) |
| 12 | | | { |
| 13 | | | mode_t old_umask; |
| 14 | | | int fd; |
| 15 | | | |
| 16 | | | old_umask = umask(0777 ^ mode); |
| 17 | [+] | | fd = net_listen_unix_unlink_stale(path, backlog); |
Event 1:
The resource of interest is allocated inside net_listen_unix_unlink_stale().
hide
|
|
 |
| 18 | | | umask(old_umask); |
| 19 | | | |
| 20 | | | if (fd < 0) { |
Event 18:
Skipping " if". fd < 0 evaluates to false.
hide
|
|
| 21 | | | i_error("net_listen_unix(%s) failed: %m", path); |
| 22 | | | return -1; |
| 23 | | | } |
| 24 | | | |
| 25 | | | if (uid != (uid_t)-1 || gid != (gid_t)-1) { |
Event 19:
Taking true branch. uid != (uid_t)-1 evaluates to true.
hide
|
|
| 26 | | | |
| 27 | | | if (chown(path, uid, gid) < 0) { |
Event 20:
Taking true branch. chown(path, uid, gid) < 0 evaluates to true.
hide
|
|
| 28 | | | i_error("chown(%s, %s, %s) failed: %m", |
| 29 | | | path, dec2str(uid), dec2str(gid)); |
| 30 | | | return -1; |
Leak
There are no remaining references to the resource socket(1, SOCK_STREAM, 0) from network.c:375. The issue can occur if the highlighted code executes. See related events 1, 2, 4, 5, 7, 9, 11, 12, 13, 15, 16, 17, and 21. Show: All events | Only primary events |
|
| |