(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/master/ssl-init-main.c) |
| |
| 15 | | | static int generate_parameters_file(const char *fname) |
| 16 | | | { |
| 17 | | | const char *temp_fname; |
| 18 | | | struct file_lock *lock; |
| 19 | | | mode_t old_mask; |
| 20 | | | int fd, ret; |
| 21 | | | |
| 22 | [+] | | temp_fname = t_strconcat(fname, ".tmp", NULL); |
 |
| 23 | | | |
| 24 | | | old_mask = umask(0); |
| 25 | | | fd = open(temp_fname, O_WRONLY | O_CREAT, 0644);
x /usr/include/bits/fcntl.h |
| |
38 | #define O_CREAT 0100 /* not fcntl */ |
| |
|
| 26 | | | umask(old_mask); |
| 27 | | | |
| 28 | | | if (fd == -1) { |
Event 8:
Skipping " if". fd == -1 evaluates to false.
hide
|
|
| 29 | | | i_fatal("Can't create temporary SSL parameters file %s: %m", |
| 30 | | | temp_fname); |
| 31 | | | } |
| 32 | | | |
| 33 | | | |
| 34 | | | |
| 35 | | | ret = file_try_lock(fd, temp_fname, F_WRLCK,
x /usr/include/bits/fcntl.h |
| |
133 | #define F_WRLCK 1 /* Write lock. */ |
| |
|
Event 9:
temp_fname, which evaluates to NULL, is passed to file_try_lock() as the second argument. See related event 6.
hide
|
|
| 36 | [+] | | FILE_LOCK_METHOD_FCNTL, &lock); |
 |
| |