openbsd-ports/mail/dspam/patches/patch-src_client_c

83 lines
2.4 KiB
Plaintext

$OpenBSD: patch-src_client_c,v 1.3 2006/04/28 01:13:37 brad Exp $
--- src/client.c.orig Wed Feb 15 21:06:35 2006
+++ src/client.c Thu Apr 27 10:03:28 2006
@@ -108,7 +108,7 @@ int client_process(AGENT_CTX *ATX, buffe
/* RCPT TO - Send recipient information */
- strcpy(buf, "RCPT TO: ");
+ strlcpy(buf, "RCPT TO: ", sizeof (buf));
node_nt = c_nt_first(ATX->users, &c_nt);
while(node_nt != NULL) {
const char *ptr = (const char *) node_nt->ptr;
@@ -170,7 +170,7 @@ int client_process(AGENT_CTX *ATX, buffe
if (ATX->flags & DAF_SUMMARY)
head = 1;
- line = client_getline(&TTX, 300);
+ line = client_getline(&TTX, 900);
while(line != NULL && strcmp(line, ".")) {
chomp(line);
@@ -192,7 +192,7 @@ int client_process(AGENT_CTX *ATX, buffe
break;
}
free(line);
- line = client_getline(&TTX, 300);
+ line = client_getline(&TTX, 900);
if (line) chomp(line);
}
free(line);
@@ -200,7 +200,7 @@ int client_process(AGENT_CTX *ATX, buffe
goto BAIL;
} else {
for(i=0;i<ATX->users->items;i++) {
- char *input = client_getline(&TTX, 300);
+ char *input = client_getline(&TTX, 900);
char *x;
int code = 500;
@@ -313,7 +313,7 @@ int client_connect(AGENT_CTX *ATX, int f
if (domain) {
sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
saun.sun_family = AF_UNIX;
- strcpy(saun.sun_path, host);
+ strlcpy(saun.sun_path, host, sizeof (saun.sun_path));
addr_len = sizeof(saun.sun_family) + strlen(saun.sun_path) + 1;
LOGDEBUG(INFO_CLIENT_CONNECTING, host, 0);
@@ -443,7 +443,7 @@ char * client_expect(THREAD_CTX *TTX, in
char *inp, *dup, *ptr, *ptrptr;
int recv_code;
- inp = client_getline(TTX, 300);
+ inp = client_getline(TTX, 900);
while(inp != NULL) {
recv_code = 0;
dup = strdup(inp);
@@ -467,7 +467,7 @@ char * client_expect(THREAD_CTX *TTX, in
strlcpy(err, inp, len);
free(inp);
- inp = client_getline(TTX, 300);
+ inp = client_getline(TTX, 900);
}
return NULL;
@@ -512,13 +512,13 @@ int client_getcode(THREAD_CTX *TTX, char
char *inp, *ptr, *ptrptr;
int i;
- inp = client_getline(TTX, 300);
+ inp = client_getline(TTX, 900);
if (!inp)
return EFAILURE;
while(inp && !strncmp(inp, "250-", 4)) {
free(inp);
- inp = client_getline(TTX, 300);
+ inp = client_getline(TTX, 900);
}
strlcpy(err, inp, len);