From nobody Sat Feb 5 16:27:29 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BE530198CF72; Sat, 5 Feb 2022 16:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jrd9F5Qjfz3PXX; Sat, 5 Feb 2022 16:27:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644078450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=557+IXNh+avxuD6S/6EtBirrVTWX4rKQyWq4bBNmTDQ=; b=LIl87QWfKI6vaGZpvd/PRUBuvUppUPLqmarsZzWC2+pJgludILM8u7ixhk/vW9qbj5wuaO ogX7d46z2xD0jyLV2q/guTLT2D06zGoannmzCIICPjKz753pvV/nfgkk8JBkZJbz/RsoTl KSJauX9W8Y4c3GG3719mzWwAxGM7NLp9pnwK0hNyqmvNjNyaBzXcsYQBprUDU2184OVcV3 nkNlWUkX9t2rSd7MX0v4Y2cz8a/Z9+vXo5FH/dXvgItFWyrSKwh9pgXADYCdL3e9X3jvej bLiyW8Uygz2CAE17UD0cefYs0H9il5eGVEFGHsApsX88acwhOrUnn6arIgxwLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42D6D2226D; Sat, 5 Feb 2022 16:27:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 215GRTpm038814; Sat, 5 Feb 2022 16:27:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 215GRTOv038813; Sat, 5 Feb 2022 16:27:29 GMT (envelope-from git) Date: Sat, 5 Feb 2022 16:27:29 GMT Message-Id: <202202051627.215GRTOv038813@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 5c1ee92b0eba - stable/12 - dma: limit lines to 998 characters List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5c1ee92b0ebab49577d065baf7f37a8ffcde4259 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644078450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=557+IXNh+avxuD6S/6EtBirrVTWX4rKQyWq4bBNmTDQ=; b=fpO+2diQX8XoiNga0CqrqLAsCWX7cnYx/k2fVzJgpZv2FIS1Sijjro0SVoaXtmK8YG+Otn f0r1tjI/ieNM94EhzLiJeglZKw2TF95e11Tbg1T45xIydNr6992jkFoRKgfwuZn1ACXVju k1D6n8TAqFEMF5sbmX4ak4dx4bU0t49djF87b4B09dSFMbMojqHCu13hkWBNJL6jPn10K6 u9QHUO4BG0FPFma+uH5JuhHh9KdV6+jvztJzUiSBXX5cnwKSIx2wFRdweHn9THT/pHrwvT SLPrcz5N9ufHnq3pUAxeyxHzAIUapZV2jUBgJE7kTNhHHRRAhm9G3UCOW1ypag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644078450; a=rsa-sha256; cv=none; b=hwMBEv2bSWhPQqnUW0cy3P4w2Lw4c3LC8l7JDZdJwmIAwzk1etghrjvI8/tLDjCokaXi/U qwtgH+iYYc2bEYSoBSoaiZ6tHsZYCxWG5TiYc3/wJY5tAX9biehrXSd/P1rcdDjAjs44Dd s5FXkTA4hBJkfwobUWZ9UgstsGN6lll2RpnaLneqhAYtQSmipVTZd/f8Walt13nyUyJu2s aRaRUe0r5fe904mMPeZ21OZ/YcX0bQkCX1vtCBmuRmQOE1j8KXf3z8x82V+0i6XiMXW7gn P7kvM1d3LJQTt2sr4vswC9DvQuyAnKlLIoZSZ39usNpp6jvmX3ygmLB3/VOkJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5c1ee92b0ebab49577d065baf7f37a8ffcde4259 commit 5c1ee92b0ebab49577d065baf7f37a8ffcde4259 Author: Ed Maste AuthorDate: 2022-01-28 14:57:44 +0000 Commit: Ed Maste CommitDate: 2022-02-05 16:26:42 +0000 dma: limit lines to 998 characters Per RFC2822 the maximum transmitted line length is "998 characters... excluding the CRLF." In a file the maximum is 999 with the \n included. Previously mail containing a line with exactly 999 characters would bounce. PR: 208261 Reported by: Helge Oldach MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 1a0dde338df8b493d74dcb2f7bbaaa6c02cab371) --- contrib/dma/mail.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/dma/mail.c b/contrib/dma/mail.c index 48c8ee6d4dd2..9e00c22d71db 100644 --- a/contrib/dma/mail.c +++ b/contrib/dma/mail.c @@ -43,7 +43,7 @@ #include "dma.h" -#define MAX_LINE_RFC822 1000 +#define MAX_LINE_RFC822 999 /* 998 characters plus \n */ void bounce(struct qitem *it, const char *reason) @@ -378,7 +378,7 @@ readmail(struct queue *queue, int nodot, int recp_from_header) char *line = NULL; ssize_t linelen; size_t linecap = 0; - char newline[MAX_LINE_RFC822]; + char newline[MAX_LINE_RFC822 + 1]; size_t error; int had_headers = 0; int had_from = 0;