summaryrefslogtreecommitdiff
path: root/libexec/spamd
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2006-03-14 22:49:42 +0000
committerBob Beck <beck@cvs.openbsd.org>2006-03-14 22:49:42 +0000
commit21595ae490db8c9fba518454580767e39ff57ced (patch)
treea0bee9d41a6c21362b25207a3030e9291dafeec0 /libexec/spamd
parent39a73da6f1a3248d8225b2290f64a489bcf01a4a (diff)
spamd can show the wrong IP address to clients in a %A message because
the per-connection copy of the connecting address was being pointed to the on-stack copy. Spotted (and fix suggested) by Michael Durket in pr 5046 ok deraadt@
Diffstat (limited to 'libexec/spamd')
-rw-r--r--libexec/spamd/spamd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c
index 3235dfbd9ac..50817fe6c0e 100644
--- a/libexec/spamd/spamd.c
+++ b/libexec/spamd/spamd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spamd.c,v 1.81 2005/11/30 20:44:07 deraadt Exp $ */
+/* $OpenBSD: spamd.c,v 1.82 2006/03/14 22:49:41 beck Exp $ */
/*
* Copyright (c) 2002 Theo de Raadt. All rights reserved.
@@ -576,7 +576,7 @@ initcon(struct con *cp, int fd, struct sockaddr *sa)
errx(1, "not supported yet");
memcpy(&cp->ss, sa, sa->sa_len);
cp->af = sa->sa_family;
- cp->ia = &((struct sockaddr_in *)sa)->sin_addr;
+ cp->ia = &((struct sockaddr_in *)&cp->ss)->sin_addr;
cp->blacklists = sdl_lookup(blacklists, cp->af, cp->ia);
cp->stutter = (greylist && !grey_stutter && cp->blacklists == NULL) ?
0 : stutter;