efb3ec7a2b
pen allows several servers to appear as one to the outside and automatically detects servers that are down and distributes clients among the available servers. ok pvalchev@.
19 lines
603 B
Plaintext
19 lines
603 B
Plaintext
$OpenBSD: patch-pen_c,v 1.1.1.1 2002/04/29 03:18:20 wcobb Exp $
|
|
--- pen.c.orig Thu Sep 13 12:47:33 2001
|
|
+++ pen.c Thu Sep 13 12:55:37 2001
|
|
@@ -641,12 +641,12 @@ static int open_listener(char *a)
|
|
serv_addr.sin_family = AF_INET;
|
|
p = strchr(a, ':');
|
|
if (p) {
|
|
- strcpy(b, a);
|
|
+ strlcpy(b, a, sizeof(b));
|
|
p = strchr(b, ':');
|
|
*p = '\0';
|
|
port = getport(p+1);
|
|
setipaddress(&serv_addr.sin_addr, b);
|
|
- sprintf(b, inet_ntoa(serv_addr.sin_addr));
|
|
+ snprintf(b, (sizeof(b) - 1), inet_ntoa(serv_addr.sin_addr));
|
|
} else {
|
|
port = getport(a);
|
|
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
|