summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-08-25 23:28:39 +0000
committerStef Walter <stef@memberwebs.com>2004-08-25 23:28:39 +0000
commitfdbef128b98cc85edb4b3654f71d8ce036e83eaa (patch)
tree7061f0d8c31d1c54a45445f7245d79dfe64ff651
parent3a17efa4267ff1fbb2e1783b1ab7a48a2525d275 (diff)
Safer line length
-rw-r--r--common/smtppass.h13
-rw-r--r--src/clamsmtpd.h13
2 files changed, 22 insertions, 4 deletions
diff --git a/common/smtppass.h b/common/smtppass.h
index 6c08ef4..4c581d2 100644
--- a/common/smtppass.h
+++ b/common/smtppass.h
@@ -39,8 +39,17 @@
#ifndef __CLAMSMTPD_H__
#define __CLAMSMTPD_H__
-/* A generous maximum line length. */
-#define LINE_LENGTH 2000
+/*
+ * A generous maximum line length. It needs to be longer than
+ * a full path on this system can be, because we pass the file
+ * name to clamd.
+ */
+
+#if 2000 > MAXPATHLEN
+ #define LINE_LENGTH 2000
+#else
+ #define LINE_LENGTH (MAXPATHLEN + 128)
+#endif
typedef struct clamsmtp_context
{
diff --git a/src/clamsmtpd.h b/src/clamsmtpd.h
index 6c08ef4..4c581d2 100644
--- a/src/clamsmtpd.h
+++ b/src/clamsmtpd.h
@@ -39,8 +39,17 @@
#ifndef __CLAMSMTPD_H__
#define __CLAMSMTPD_H__
-/* A generous maximum line length. */
-#define LINE_LENGTH 2000
+/*
+ * A generous maximum line length. It needs to be longer than
+ * a full path on this system can be, because we pass the file
+ * name to clamd.
+ */
+
+#if 2000 > MAXPATHLEN
+ #define LINE_LENGTH 2000
+#else
+ #define LINE_LENGTH (MAXPATHLEN + 128)
+#endif
typedef struct clamsmtp_context
{