(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/istream.c) |
| |
| 235 | | | static char *i_stream_next_line_finish(struct istream_private *stream, size_t i) |
| 236 | | | { |
| 237 | | | char *ret; |
| 238 | | | size_t end; |
| 239 | | | |
| 240 | | | if (i > 0 && stream->buffer[i-1] == '\r') |
| 241 | | | end = i - 1; |
| 242 | | | else |
| 243 | | | end = i; |
| 244 | | | |
| 245 | | | if (stream->w_buffer != NULL) { |
| 246 | | | |
| 247 | | | stream->w_buffer[end] = '\0'; |
| 248 | | | ret = (char *)stream->w_buffer + stream->skip; |
| 249 | | | } else { |
| 250 | | | |
| 251 | | | if (stream->line_str == NULL) |
| 252 | | | stream->line_str = str_new(default_pool, 256); |
| 253 | | | str_truncate(stream->line_str, 0); |
| 254 | | | str_append_n(stream->line_str, stream->buffer + stream->skip, |
| 255 | | | end - stream->skip); |
| 256 | | | ret = str_c_modifiable(stream->line_str); |
Unreachable Call
The highlighted code will not execute under any circumstances. |
|
| 257 | | | } |
| 258 | | | |
| 259 | | | if (i < stream->pos) |
| 260 | | | i++; |
| 261 | | | stream->istream.v_offset += i - stream->skip; |
| 262 | | | stream->skip = i; |
| 263 | | | return ret; |
| 264 | | | } |
| |