fixed host conversion length check

This commit is contained in:
Martin Willi
2007-01-03 09:25:57 +00:00
parent 6b50ddfa0d
commit 60d79e496b
+1 -1
View File
@@ -428,7 +428,7 @@ static void receive_messages(private_kernel_interface_t *this)
static void host2xfrm(host_t *host, xfrm_address_t *xfrm) static void host2xfrm(host_t *host, xfrm_address_t *xfrm)
{ {
chunk_t chunk = host->get_address(host); chunk_t chunk = host->get_address(host);
memcpy(xfrm, chunk.ptr, max(chunk.len, sizeof(xfrm_address_t))); memcpy(xfrm, chunk.ptr, min(chunk.len, sizeof(xfrm_address_t)));
} }
/** /**