diff options
author | Stef Walter <stef@memberwebs.com> | 2004-08-16 16:22:42 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2004-08-16 16:22:42 +0000 |
commit | 94d55ab8eca76fdd6cf435bff74c1e13d2ca1a88 (patch) | |
tree | 99d3f32c4ab3666fc875f1fd8405b4244737cf0b | |
parent | e2c0ce20df5987ec798f86f0be1cf38d48f7213c (diff) |
More sanity checks for custom headers.
-rw-r--r-- | common/smtppass.c | 7 | ||||
-rw-r--r-- | src/clamsmtpd.c | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/common/smtppass.c b/common/smtppass.c index 6b43058..853e931 100644 --- a/common/smtppass.c +++ b/common/smtppass.c @@ -233,7 +233,14 @@ int main(int argc, char* argv[]) if(strlen(optarg) == 0) g_header = NULL; else + { g_header = optarg; + + /* Trim off any ending newline chars */ + t = g_header + strlen(g_header); + while(t > g_header && (*(t - 1) == '\r' || *(t - 1) == '\n')) + *(--t) = 0; + } break; /* Change our listening port */ diff --git a/src/clamsmtpd.c b/src/clamsmtpd.c index 6b43058..853e931 100644 --- a/src/clamsmtpd.c +++ b/src/clamsmtpd.c @@ -233,7 +233,14 @@ int main(int argc, char* argv[]) if(strlen(optarg) == 0) g_header = NULL; else + { g_header = optarg; + + /* Trim off any ending newline chars */ + t = g_header + strlen(g_header); + while(t > g_header && (*(t - 1) == '\r' || *(t - 1) == '\n')) + *(--t) = 0; + } break; /* Change our listening port */ |