(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/util/rawlog.c) |
| |
| 96 | | | static void proxy_write_out(struct rawlog_proxy *proxy, |
| 97 | | | const void *data, size_t size) |
| 98 | | | { |
| 99 | | | struct tm *tm; |
| 100 | | | char buf[256]; |
| 101 | | | |
| 102 | | | if (proxy->fd_out == -1 || size == 0) |
Event 1:
Skipping " if". - proxy->fd_out == -1 evaluates to false.
- size == 0 evaluates to false.
hide
|
|
| 103 | | | return; |
| 104 | | | |
| 105 | | | if (proxy->last_out_lf && |
Event 2:
Skipping " if". proxy->last_out_lf evaluates to false.
hide
|
|
| 106 | | | (proxy->flags & RAWLOG_FLAG_LOG_TIMESTAMPS) != 0 && |
| 107 | | | ioloop_time - proxy->last_write >= TIMESTAMP_WAIT_TIME) { |
| 108 | | | tm = localtime(&ioloop_time); |
| 109 | | | |
| 110 | | | if (strftime(buf, sizeof(buf), TIMESTAMP_FORMAT, tm) <= 0)
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/util/rawlog.c |
| |
23 | #define TIMESTAMP_FORMAT "* OK [RAWLOG TIMESTAMP] %Y-%m-%d %H:%M:%S\n" |
| |
|
| 111 | | | i_fatal("strftime() failed"); |
| 112 | | | if (write_full(proxy->fd_out, buf, strlen(buf)) < 0) |
| 113 | | | i_fatal("Can't write to log file: %m"); |
| 114 | | | } |
| 115 | | | |
| 116 | | | if ((proxy->flags & RAWLOG_FLAG_LOG_BOUNDARIES) != 0) |
Event 3:
Skipping " if". (proxy->flags & RAWLOG_FLAG_LOG_BOUNDARIES) != 0 evaluates to false.
hide
|
|
| 117 | | | write_full(proxy->fd_out, "<<<", 3); |
| 118 | | | if (write_full(proxy->fd_out, data, size) < 0) { |
Event 4:
Taking false branch. write_full(...) < 0 evaluates to false.
hide
|
|
| 119 | | | |
| 120 | | | i_error("write(out) failed: %m"); |
| 121 | | | (void)close(proxy->fd_out); |
| 122 | | | proxy->fd_out = -1; |
| 123 | | | } else if ((proxy->flags & RAWLOG_FLAG_LOG_BOUNDARIES) != 0) { |
Event 5:
Skipping " if". (proxy->flags & RAWLOG_FLAG_LOG_BOUNDARIES) != 0 evaluates to false.
hide
|
|
| 124 | | | write_full(proxy->fd_out, ">>>\n", 4); |
| 125 | | | } |
| 126 | | | |
| 127 | | | proxy->last_write = ioloop_time; |
| 128 | | | proxy->last_out_lf = ((const unsigned char *)buf)[size-1] == '\n' || |
| |