diff options
| author | Sergey Poznyakoff <gray@gnu.org> | 2020-03-31 21:34:49 +0300 |
|---|---|---|
| committer | Sergey Poznyakoff <gray@gnu.org> | 2020-03-31 21:34:49 +0300 |
| commit | b8664765e1c58e4443f86c57245d3d20dc31ce17 (patch) | |
| tree | 9a9d363e9974240b2eafe76d6e0d8238494d5bf1 | |
| parent | 835b068ef5b8aa6b53632a33cdcffba2239c4531 (diff) | |
| download | mailutils-b8664765e1c58e4443f86c57245d3d20dc31ce17.tar.gz | |
mbox: fix a bug in expunge routine
The bug will manifest itself by removal of the trailing newline
in the last message in a block of unchanged messages when expunging
the mailbox after removal of one or more messages before that block.
Bug reported by Ken Olum.
* libproto/mbox/mbox.c (mbox_expunge_unlocked): Fix an off-by-one
error in computation of the file chunk size.
| -rw-r--r-- | libproto/mbox/mbox.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libproto/mbox/mbox.c b/libproto/mbox/mbox.c index 52e48f8..768e464 100644 --- a/libproto/mbox/mbox.c +++ b/libproto/mbox/mbox.c @@ -1269,7 +1269,7 @@ mbox_expunge_unlocked (mu_mailbox_t mailbox, size_t dirty, int remove_deleted, return status; } status = mu_stream_copy (tempstr, mailbox->stream, - mum->body_end - mum->envel_from, NULL); + mum->body_end - mum->envel_from + 1, NULL); if (status) { mu_error (_("%s:%d: error copying: %s"), |
