View | Details | Raw Unified | Return to bug 208261 | Differences between
and this patch

Collapse All | Expand All

(-)contrib/dma/dma.h (+1 lines)
Lines 60-65 Link Here
60
#endif
60
#endif
61
#define	SMTP_PORT	25		/* Default SMTP port */
61
#define	SMTP_PORT	25		/* Default SMTP port */
62
#define CON_TIMEOUT	(5*60)		/* Connection timeout per RFC5321 */
62
#define CON_TIMEOUT	(5*60)		/* Connection timeout per RFC5321 */
63
#define MAX_LINE_RFC822 1000		/* Max line length per RFC822 */
63
64
64
#define STARTTLS	0x002		/* StartTLS support */
65
#define STARTTLS	0x002		/* StartTLS support */
65
#define SECURETRANS	0x004		/* SSL/TLS in general */
66
#define SECURETRANS	0x004		/* SSL/TLS in general */
(-)contrib/dma/local.c (-2 / +2 lines)
Lines 126-132 Link Here
126
deliver_local(struct qitem *it)
126
deliver_local(struct qitem *it)
127
{
127
{
128
	char fn[PATH_MAX+1];
128
	char fn[PATH_MAX+1];
129
	char line[1000];
129
	char line[MAX_LINE_RFC822];
130
	const char *sender;
130
	const char *sender;
131
	const char *newline = "\n";
131
	const char *newline = "\n";
132
	size_t linelen;
132
	size_t linelen;
Lines 207-213 Link Here
207
	while (!feof(it->mailf)) {
207
	while (!feof(it->mailf)) {
208
		if (fgets(line, sizeof(line), it->mailf) == NULL)
208
		if (fgets(line, sizeof(line), it->mailf) == NULL)
209
			break;
209
			break;
210
		linelen = strlen(line);
210
		linelen = strnlen(line, sizeof(line));
211
		if (linelen == 0 || line[linelen - 1] != '\n') {
211
		if (linelen == 0 || line[linelen - 1] != '\n') {
212
			syslog(LOG_CRIT, "local delivery failed: corrupted queue file");
212
			syslog(LOG_CRIT, "local delivery failed: corrupted queue file");
213
			snprintf(errmsg, sizeof(errmsg), "corrupted queue file");
213
			snprintf(errmsg, sizeof(errmsg), "corrupted queue file");
(-)contrib/dma/mail.c (-2 lines)
Lines 41-48 Link Here
41
41
42
#include "dma.h"
42
#include "dma.h"
43
43
44
#define MAX_LINE_RFC822	1000
45
46
void
44
void
47
bounce(struct qitem *it, const char *reason)
45
bounce(struct qitem *it, const char *reason)
48
{
46
{
(-)contrib/dma/net.c (-2 / +2 lines)
Lines 352-358 Link Here
352
deliver_to_host(struct qitem *it, struct mx_hostentry *host)
352
deliver_to_host(struct qitem *it, struct mx_hostentry *host)
353
{
353
{
354
	struct authuser *a;
354
	struct authuser *a;
355
	char line[1000];
355
	char line[MAX_LINE_RFC822];
356
	size_t linelen;
356
	size_t linelen;
357
	int fd, error = 0, do_auth = 0, res = 0;
357
	int fd, error = 0, do_auth = 0, res = 0;
358
358
Lines 452-458 Link Here
452
	while (!feof(it->mailf)) {
452
	while (!feof(it->mailf)) {
453
		if (fgets(line, sizeof(line), it->mailf) == NULL)
453
		if (fgets(line, sizeof(line), it->mailf) == NULL)
454
			break;
454
			break;
455
		linelen = strlen(line);
455
		linelen = strnlen(line, sizeof(line));
456
		if (linelen == 0 || line[linelen - 1] != '\n') {
456
		if (linelen == 0 || line[linelen - 1] != '\n') {
457
			syslog(LOG_CRIT, "remote delivery failed: corrupted queue file");
457
			syslog(LOG_CRIT, "remote delivery failed: corrupted queue file");
458
			snprintf(errmsg, sizeof(errmsg), "corrupted queue file");
458
			snprintf(errmsg, sizeof(errmsg), "corrupted queue file");

Return to bug 208261