(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/istream-concat.c) |
| |
| 232 | | | struct istream *i_stream_create_concat(struct istream *input[]) |
| 233 | | | { |
| 234 | | | struct concat_istream *cstream; |
| 235 | | | unsigned int count; |
| 236 | | | size_t max_buffer_size = I_STREAM_MIN_SIZE; |
| 237 | | | bool blocking = TRUE, seekable = TRUE; |
Event 1:
!0 evaluates to true.
hide
Event 2:
!0 evaluates to true.
hide
|
|
| 238 | | | |
| 239 | | | |
| 240 | | | |
| 241 | | | for (count = 0; input[count] != NULL; count++) { |
Event 4:
During loop iterations, count is set to count + 1, which evaluates to an unknown [ ?unknown: the analysis lost precision when tracking this value, so this warning may be a false positive] value . - Determines the allocation size later.
hide
Event 5:
Continuing from loop body. Entering loop body. input[count] != (void *)0 evaluates to true.
hide
Event 9:
count is set to count + 1, which evaluates to the value assigned to count, plus 2. See related event 4.
hide
Event 10:
Continuing from loop body. Leaving loop. input[count] != (void *)0 evaluates to false.
hide
|
|
| 242 | | | size_t cur_max = input[count]->real_stream->max_buffer_size; |
| 243 | | | |
| 244 | | | if (cur_max > max_buffer_size) |
Event 6:
Skipping " if". cur_max > max_buffer_size evaluates to false.
hide
|
|
| 245 | | | max_buffer_size = cur_max; |
| 246 | | | if (!input[count]->blocking) |
Event 7:
Skipping " if". input[count]->blocking evaluates to true.
hide
|
|
| 247 | | | blocking = FALSE; |
| 248 | | | if (!input[count]->seekable) |
Event 8:
Skipping " if". input[count]->seekable evaluates to true.
hide
|
|
| 249 | | | seekable = FALSE; |
| 250 | | | i_stream_ref(input[count]); |
| 251 | | | } |
| 252 | | | i_assert(count != 0);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
189 | #define i_assert(expr) STMT_START{ \ |
190 | if (unlikely(!(expr))) \ |
191 | i_panic("file %s: line %d (%s): assertion failed: (%s)", \ |
192 | __FILE__, \ |
193 | __LINE__, \ |
194 | __PRETTY_FUNCTION__, \ |
195 | #expr); }STMT_END |
| |
|
Event 11:
Skipping " if". count != 0 evaluates to true.
hide
Event 12:
Skipping " if". !(count != 0) evaluates to false.
hide
Event 13:
Skipping " if". !!(count != 0) evaluates to true.
hide
Event 14:
Skipping " if". !!!(count != 0) evaluates to false.
hide
Event 15:
Skipping " if". __builtin_expect(...) evaluates to false.
hide
|
|
| 253 | | | |
| 254 | | | cstream = i_new(struct concat_istream, 1);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/imem.h |
| |
8 | #define i_new(type, count) ((type *) i_malloc(sizeof(type) * (count))) |
| |
|
| 255 | [+] | | cstream->input = i_new(struct istream *, count + 1);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/imem.h |
| |
8 | #define i_new(type, count) ((type *) i_malloc(sizeof(type) * (count))) |
| |
|
Event 16:
4 * count + 4, which evaluates to the value assigned to count at istream-concat.c:241, times 4, plus 12, is passed to i_malloc(). - This multiplication may overflow and it is used as the allocation size later.
See related event 9.
hide
|
|
 |
| |