Skip to content

Commit

Permalink
lib-storage: Fix buffer overflow when reading oversized hdr-pop3-uidl…
Browse files Browse the repository at this point in the history
… header
  • Loading branch information
sirainen authored and villesavolainen committed Mar 28, 2019
1 parent 03d4494 commit d798453
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib-storage/index/index-pop3-uidl.c
Expand Up @@ -37,7 +37,7 @@ bool index_pop3_uidl_can_exist(struct mail *mail)
/* this header isn't set yet */
return TRUE;
}
memcpy(&uidl, data, size);
memcpy(&uidl, data, sizeof(uidl));
return mail->uid <= uidl.max_uid_with_pop3_uidl;
}

Expand Down Expand Up @@ -95,7 +95,7 @@ void index_pop3_uidl_update_exists_finish(struct mailbox_transaction_context *tr

/* check if we have already the same header */
if (size >= sizeof(uidl)) {
memcpy(&uidl, data, size);
memcpy(&uidl, data, sizeof(uidl));
if (trans->highest_pop3_uidl_uid == uidl.max_uid_with_pop3_uidl)
return;
}
Expand Down

0 comments on commit d798453

Please sign in to comment.