File openswan_04_build_fixes.dif of Package openswan
diff -Nur openswan-2.6.20-orig//programs/pluto/connections.c openswan-2.6.20-new//programs/pluto/connections.c
--- openswan-2.6.20-orig//programs/pluto/connections.c 2009-02-10 05:54:47.000000000 +0100
+++ openswan-2.6.20-new//programs/pluto/connections.c 2009-03-06 11:25:39.000000000 +0100
@@ -589,9 +589,9 @@
if(dohost_name) {
if(this->host_addr_name) {
- strncat(host_space, "<", sizeof(host_space)-1);
- strncat(host_space, this->host_addr_name, sizeof(host_space)-1);
- strncat(host_space, ">", sizeof(host_space));
+ strncat(host_space, "<", sizeof(host_space)-strlen(host_space)-1);
+ strncat(host_space, this->host_addr_name, sizeof(host_space)-strlen(host_space)-1);
+ strncat(host_space, ">", sizeof(host_space)-strlen(host_space)-1);
}
}
diff -Nur openswan-2.6.20-orig//programs/pluto/demux.c openswan-2.6.20-new//programs/pluto/demux.c
--- openswan-2.6.20-orig//programs/pluto/demux.c 2009-02-10 05:54:47.000000000 +0100
+++ openswan-2.6.20-new//programs/pluto/demux.c 2009-03-06 11:26:56.000000000 +0100
@@ -229,7 +229,7 @@
read_packet(struct msg_digest *md)
{
const struct iface_port *ifp = md->iface;
- int packet_len;
+ ssize_t packet_len;
/* ??? this buffer seems *way* too big */
u_int8_t bigbuffer[MAX_INPUT_UDP_SIZE];
#ifdef NAT_TRAVERSAL
@@ -279,7 +279,7 @@
from_ugh = undisclosed;
}
else if (from_len
- < (int) (offsetof(struct sockaddr, sa_family) + sizeof(from.sa.sa_family)))
+ < (offsetof(struct sockaddr, sa_family) + sizeof(from.sa.sa_family)))
{
from_ugh = "truncated";
}