summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorMarius Tomaschewski <mt@suse.de>2011-08-09 12:25:46 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-08-09 12:25:46 +0200
commit9bea045e60fa612336ae6a78267284bcec2e9e25 (patch)
treed57e026558cf9c49b04d8d35dc5e327399c5edaf /runtime
parenta3953fbee90045b96bd5ef44b64883a6bff57fee (diff)
downloadrsyslog-9bea045e60fa612336ae6a78267284bcec2e9e25.tar.gz
rsyslog-9bea045e60fa612336ae6a78267284bcec2e9e25.tar.xz
rsyslog-9bea045e60fa612336ae6a78267284bcec2e9e25.zip
bugfix: memcpy overflow can occur in allowed sender checking
...if a host name is resolved to IPv4-mapped-on-IPv6 address. Found by Ismail Dönmez at suse. Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
Diffstat (limited to 'runtime')
-rw-r--r--runtime/net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/net.c b/runtime/net.c
index fe6eef5b..0866efd7 100644
--- a/runtime/net.c
+++ b/runtime/net.c
@@ -721,7 +721,7 @@ static rsRetVal AddAllowedSender(struct AllowedSenders **ppRoot, struct AllowedS
SIN(allowIP.addr.NetAddr)->sin_port = 0;
memcpy(&(SIN(allowIP.addr.NetAddr)->sin_addr.s_addr),
&(SIN6(res->ai_addr)->sin6_addr.s6_addr32[3]),
- sizeof (struct sockaddr_in));
+ sizeof (in_addr_t));
if((iRet = AddAllowedSenderEntry(ppRoot, ppLast, &allowIP,
iSignificantBits))