summaryrefslogtreecommitdiff
path: root/mail/dbmail/files/patch-0004-prevent-assertion-in-p_string_erase
diff options
context:
space:
mode:
authorMuhammad Moinur Rahman <bofh@FreeBSD.org>2017-02-24 21:15:52 +0000
committerMuhammad Moinur Rahman <bofh@FreeBSD.org>2017-02-24 21:15:52 +0000
commit9eff14e4885b86d6f5a8b35c69ebaabd9e74df06 (patch)
tree443206cca0976456f3fd02dad4c4ebfe294c5904 /mail/dbmail/files/patch-0004-prevent-assertion-in-p_string_erase
parentdevel/py-pathlib2: add missing dependency (diff)
mail/dbmail: adopt latest fixes from git:
- login_disabled option before starttls for pop3 - fix compiler warnings for GCC5 - Fix IMAP mailbox maintanence - prevent assertion in p_string_erase - improve crypt authentication, also don't segfault when spasswd is empty - simplify log_query_time duration logic - Disconnect IMAP clients if only few free FDs left - Add primary key constraint to dbmail_authlog - Rework temporary connection failures - Give sensible default for retry 120s - Add retries for binding and searching - Bump search timeout to 60s - Increase ldap timeout to 600s 10 mins - Refactor deprecated functions - Get timeout from config - Remove redundant event_assign - Remove deprecated non functioning g_mem_profile - Add definition for authldap_free - Revert inadvertent event_assign removal - Reduce failed LDAP connection for search to error - Update LDAP to non deprecated search - Clear the ldap connection - Update ldap deprecated unbind - Fix typo - Update to ldap_unbind_ext_s and remove redundant sigaction - Rebalance commit rollback - Ensure mailbox2dbmail is using Python 2 - Tidy mailbox2dbmail man page - Update description of pid file location in server man page - Boundaries fixups ordering of parts do not add newline on - Prepend headers during delivery - Allow for systems that don't use proc PR: 210274 Submitted by: fluffy
Notes
Notes: svn path=/head/; revision=434749
Diffstat (limited to 'mail/dbmail/files/patch-0004-prevent-assertion-in-p_string_erase')
-rw-r--r--mail/dbmail/files/patch-0004-prevent-assertion-in-p_string_erase41
1 files changed, 41 insertions, 0 deletions
diff --git a/mail/dbmail/files/patch-0004-prevent-assertion-in-p_string_erase b/mail/dbmail/files/patch-0004-prevent-assertion-in-p_string_erase
new file mode 100644
index 000000000000..dcef53496196
--- /dev/null
+++ b/mail/dbmail/files/patch-0004-prevent-assertion-in-p_string_erase
@@ -0,0 +1,41 @@
+From b6f28ffa54e6533fd0d8676248d0c9bc6d4bd859 Mon Sep 17 00:00:00 2001
+From: Paul J Stevens <p.stevens@lukkien.com>
+Date: Sun, 10 Jan 2016 20:01:31 +0100
+Subject: [PATCH 04/33] prevent assertion in p_string_erase
+
+---
+ src/dm_imapsession.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git src/dm_imapsession.c src/dm_imapsession.c
+index dbf1834..67eae60 100644
+--- src/dm_imapsession.c
++++ src/dm_imapsession.c
+@@ -870,19 +870,20 @@ static void _imap_send_part(ImapSession *self, GMimeObject *part, body_fetch *bo
+ } else {
+ char *tmp = imap_get_logical_part(part,type);
+ String_T str = p_string_new(self->pool, tmp);
++ size_t len = p_string_len(str);
+ g_free(tmp);
+
+- if (p_string_len(str) < 1) {
++ if (len < 1) {
+ dbmail_imap_session_buff_printf(self, "] NIL");
+ } else {
+ uint64_t cnt = 0;
+ if (bodyfetch->octetcnt > 0) {
+- cnt = get_dumpsize(bodyfetch, p_string_len(str));
++ cnt = get_dumpsize(bodyfetch, len);
+ dbmail_imap_session_buff_printf(self, "]<%" PRIu64 "> {%" PRIu64 "}\r\n", bodyfetch->octetstart, cnt);
+- p_string_erase(str,0,bodyfetch->octetstart);
++ p_string_erase(str,0,min(bodyfetch->octetstart,len));
+ p_string_truncate(str,cnt);
+ } else {
+- dbmail_imap_session_buff_printf(self, "] {%" PRIu64 "}\r\n", p_string_len(str));
++ dbmail_imap_session_buff_printf(self, "] {%" PRIu64 "}\r\n", len);
+ }
+ dbmail_imap_session_buff_printf(self,"%s", p_string_str(str));
+ }
+--
+2.10.1 (Apple Git-78)
+