(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/istream.c) |
| |
| 67 | | | ssize_t i_stream_read(struct istream *stream) |
| 68 | | | { |
| 69 | | | struct istream_private *_stream = stream->real_stream; |
| 70 | | | size_t old_size; |
| 71 | | | ssize_t ret; |
| 72 | | | |
| 73 | | | if (unlikely(stream->closed)) |
| 74 | | | return -1; |
| 75 | | | |
| 76 | | | stream->eof = FALSE; |
| 77 | | | stream->stream_errno = 0; |
| 78 | | | |
| 79 | | | old_size = _stream->pos - _stream->skip; |
| 80 | | | ret = _stream->read(_stream); |
| 81 | | | switch (ret) { |
| 82 | | | case -2: |
| 83 | | | i_assert(_stream->skip != _stream->pos);
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 |
| |
|
| 84 | | | break; |
| 85 | | | case -1: |
| 86 | | | if (stream->stream_errno != 0) { |
| 87 | | | |
| 88 | | | |
| 89 | | | stream->eof = TRUE; |
Unreachable Computation
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 90 | | | } else { |
| 91 | | | i_assert(stream->eof);
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 |
| |
|
| 92 | | | } |
| 93 | | | break; |
| 94 | | | case 0: |
| 95 | | | 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 |
| |
|
| 96 | | | break; |
| 97 | | | default: |
| 98 | | | i_assert(ret > 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 |
| |
|
| 99 | | | i_assert((size_t)ret+old_size == _stream->pos - _stream->skip);
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 |
| |
|
| 100 | | | break; |
| 101 | | | } |
| 102 | | | return ret; |
| 103 | | | } |
| |