From 21595ae490db8c9fba518454580767e39ff57ced Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Tue, 14 Mar 2006 22:49:42 +0000 Subject: 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@ --- libexec/spamd/spamd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libexec/spamd') 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; -- cgit v1.2.3