(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/mbox/mbox-sync-update.c) |
| |
| 287 | | | static void mbox_sync_update_line(struct mbox_sync_mail_context *ctx, |
| 288 | | | size_t pos, string_t *new_line) |
| 289 | | | { |
| 290 | | | const char *hdr, *p; |
| 291 | | | uoff_t file_pos; |
| 292 | | | |
| 293 | | | if (ctx-> > pos) |
Event 1:
Skipping " if". ctx-> > pos evaluates to false.
hide
|
|
| 294 | | | ctx-> = pos; |
| 295 | | | |
| 296 | | | |
| 297 | | | hdr = p = str_c(ctx->) + pos; |
| 298 | | | for (;;) { |
| 299 | | | p = strchr(p, '\n'); |
| 300 | | | if (p == NULL) { |
Event 2:
Taking true branch. p == (void *)0 evaluates to true.
hide
|
|
| 301 | | | |
| 302 | | | p = hdr + strlen(hdr); |
| 303 | | | break; |
| 304 | | | } |
| 305 | | | if (p[1] != '\t' && p[1] != ' ') |
| 306 | | | break; |
| 307 | | | p += 2; |
| 308 | | | } |
| 309 | | | |
| 310 | | | file_pos = pos + ctx->hdr_offset; |
| 311 | | | if (ctx->mail.space > 0 && ctx->mail.offset >= file_pos && |
Event 3:
Skipping " if". ctx->mail.space > 0 evaluates to false.
hide
|
|
| 312 | | | ctx->mail.offset < file_pos + (p - hdr)) { |
| 313 | | | |
| 314 | | | ctx->mail.offset = ctx->hdr_offset; |
| 315 | | | ctx->mail.space = 0; |
| 316 | | | } |
| 317 | | | |
| 318 | | | mbox_sync_move_buffer(ctx, pos, str_len(new_line), p - hdr + 1); |
| 319 | [+] | | buffer_copy(ctx->, pos, new_line, 0, (size_t)-1); |
Event 4:
-1 is passed to buffer_copy() as the fifth argument. - Determines the size in the Unreasonable Size Argument warning later.
hide
|
|
 |
| |