parent
b532eded88
commit
033518a6fa
@ -1,35 +0,0 @@
|
|||||||
From e093225299cb2aba9ad88b475d01e4fc989d5448 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
|
|
||||||
Date: Thu, 26 Nov 2015 17:07:46 +0100
|
|
||||||
Subject: [PATCH 1/2] use sockaddr_storage in rc_ipaddr_local
|
|
||||||
|
|
||||||
This corrects a buffer overflow in that function
|
|
||||||
---
|
|
||||||
lib/config.c | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/lib/config.c b/lib/config.c
|
|
||||||
index 2933298..6e9af4d 100644
|
|
||||||
--- a/lib/config.c
|
|
||||||
+++ b/lib/config.c
|
|
||||||
@@ -836,7 +836,7 @@ static int find_match (const struct addrinfo* addr, const struct addrinfo *hostn
|
|
||||||
static int rc_ipaddr_local(const struct sockaddr *addr)
|
|
||||||
{
|
|
||||||
int temp_sock, res, serrno;
|
|
||||||
- struct sockaddr tmpaddr;
|
|
||||||
+ struct sockaddr_storage tmpaddr;
|
|
||||||
|
|
||||||
memcpy(&tmpaddr, addr, SA_LEN(addr));
|
|
||||||
|
|
||||||
@@ -849,7 +849,7 @@ static int rc_ipaddr_local(const struct sockaddr *addr)
|
|
||||||
} else {
|
|
||||||
((struct sockaddr_in6*)&tmpaddr)->sin6_port = 0;
|
|
||||||
}
|
|
||||||
- res = bind(temp_sock, &tmpaddr, SA_LEN(&tmpaddr));
|
|
||||||
+ res = bind(temp_sock, (struct sockaddr*)(&tmpaddr), SS_LEN(&tmpaddr));
|
|
||||||
serrno = errno;
|
|
||||||
close(temp_sock);
|
|
||||||
if (res == 0)
|
|
||||||
--
|
|
||||||
2.5.0
|
|
||||||
|
|
Loading…
Reference in new issue