Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Apr 2018 18:11:23 +0000 (UTC)
From:      Adam Weinberger <adamw@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r468228 - in head/mail/dovecot: . files
Message-ID:  <201804241811.w3OIBNFI060753@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adamw
Date: Tue Apr 24 18:11:23 2018
New Revision: 468228
URL: https://svnweb.freebsd.org/changeset/ports/468228

Log:
  Add an upstream patch to fix a panic when a malformed address line
  is fed to dovecot, as OpenSMTPd can do.
  
  Submitted by:	gahr
  Reported by:	brnrd
  Obtained from:	https://github.com/dovecot/core/commit/fbed9168dc3b104b09bd748409aec902328cd8e5

Added:
  head/mail/dovecot/files/patch-UPSTREAM-opensmtpd   (contents, props changed)
Modified:
  head/mail/dovecot/Makefile

Modified: head/mail/dovecot/Makefile
==============================================================================
--- head/mail/dovecot/Makefile	Tue Apr 24 18:07:21 2018	(r468227)
+++ head/mail/dovecot/Makefile	Tue Apr 24 18:11:23 2018	(r468228)
@@ -8,7 +8,7 @@
 
 PORTNAME=	dovecot
 PORTVERSION=	2.3.1
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	mail ipv6
 MASTER_SITES=	https://www.dovecot.org/releases/2.3/
 

Added: head/mail/dovecot/files/patch-UPSTREAM-opensmtpd
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/dovecot/files/patch-UPSTREAM-opensmtpd	Tue Apr 24 18:11:23 2018	(r468228)
@@ -0,0 +1,71 @@
+From fbed9168dc3b104b09bd748409aec902328cd8e5 Mon Sep 17 00:00:00 2001
+From: Stephan Bosch <stephan.bosch@dovecot.fi>
+Date: Tue, 10 Apr 2018 02:36:44 +0200
+Subject: [PATCH] lib-mail: message-address: Fix assert panic occurring in
+ message_address_parse_path() when no opening `<' is found.
+
+Panic was:
+
+Panic: file message-address.c: line 147 (parse_angle_addr): assertion failed: (*ctx->parser.data == '<')
+---
+ src/lib-mail/message-address.c      |  2 ++
+ src/lib-mail/test-message-address.c | 28 ++++++++++++++++++++++++++++
+ 2 files changed, 30 insertions(+)
+
+diff --git a/src/lib-mail/message-address.c b/src/lib-mail/message-address.c
+index 172a707d49..f7cc27f48e 100644
+--- src/lib-mail/message-address.c
++++ src/lib-mail/message-address.c
+@@ -424,6 +424,8 @@ message_address_parse_path_real(pool_t pool, const unsigned char *data,
+ 
+ 	if (rfc822_skip_lwsp(&ctx.parser) <= 0)
+ 		return -1;
++	if (*ctx.parser.data != '<')
++		return -1;
+ 	if ((ret=parse_angle_addr(&ctx)) < 0 ||
+ 		(ctx.addr.mailbox != NULL && ctx.addr.domain == NULL)) {
+ 		ctx.addr.invalid_syntax = TRUE;
+diff --git a/src/lib-mail/test-message-address.c b/src/lib-mail/test-message-address.c
+index c1b5566d91..21084deec9 100644
+--- src/lib-mail/test-message-address.c
++++ src/lib-mail/test-message-address.c
+@@ -395,11 +395,39 @@ static void test_message_address_path(void)
+ 	test_end();
+ }
+ 
++static void test_message_address_path_invalid(void)
++{
++	static const char *tests[] = {
++		">",
++		" > ",
++		"user@domain",
++		"  user@domain  ",
++		"user@domain>",
++		"  user@domain>  ",
++		"<user>",
++		"<@route@route2:user>",
++	};
++	const struct message_address *addr;
++	unsigned int i;
++
++	test_begin("message address path invalid");
++
++	for (i = 0; i < N_ELEMENTS(tests); i++) {
++		const char *test = tests[i];
++		int ret;
++
++		ret = test_parse_path(test, &addr);
++		test_assert_idx(ret < 0, i);
++	}
++	test_end();
++}
++
+ int main(void)
+ {
+ 	static void (*const test_functions[])(void) = {
+ 		test_message_address,
+ 		test_message_address_path,
++		test_message_address_path_invalid,
+ 		NULL
+ 	};
+ 	return test_run(test_functions);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804241811.w3OIBNFI060753>