(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/istream.c) |
| |
| 349 | | | int i_stream_read_data(struct istream *stream, const unsigned char **data_r, |
| 350 | | | size_t *size_r, size_t threshold) |
| 351 | | | { |
| 352 | | | ssize_t ret = 0; |
| 353 | | | bool read_more = FALSE; |
| 354 | | | |
| 355 | | | do { |
| 356 | | | *data_r = i_stream_get_data(stream, size_r); |
| 357 | | | if (*size_r > threshold) |
| 358 | | | return 1; |
| 359 | | | |
| 360 | | | |
| 361 | | | ret = i_stream_read(stream); |
| 362 | | | if (ret > 0) |
| 363 | | | read_more = TRUE; |
| 364 | | | } while (ret > 0); |
| 365 | | | |
| 366 | | | *data_r = i_stream_get_data(stream, size_r); |
| 367 | | | if (ret == -2) |
| 368 | | | return -2; |
| 369 | | | |
| 370 | | | if (ret == 0) { |
| 371 | | | |
| 372 | | | i_assert(!stream->blocking);
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 |
| |
|
| 373 | | | return 0; |
| 374 | | | } |
| 375 | | | if (stream->eof) { |
| 376 | | | if (read_more) { |
| 377 | | | |
| 378 | | | return 0; |
Unreachable Data Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 379 | | | } |
| 380 | | | } else { |
| 381 | | | i_assert(stream->stream_errno != 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 |
| |
|
| 382 | | | } |
| 383 | | | return -1; |
| 384 | | | } |
| |