summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-01-27 14:32:20 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-01-27 14:32:20 +0000
commitd6eddffd850f088a374447b19de986b8f04de577 (patch)
tree40d649104e1b933b4e2399ab52d6e46e69ab80fd /usr.sbin
parentb381ee4d1e32c37a7315a095720bd51f73351ee9 (diff)
the data member of ibuf was not set to the environment in control_accept()
which caused th ev_arg member of struct event to be reset after the first call to control_dispatch_ext (causing a null deref at second call). this has been driving me nuts for at least an hour ...
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/control.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/control.c b/usr.sbin/smtpd/control.c
index c0b5e06633e..3c738e177cb 100644
--- a/usr.sbin/smtpd/control.c
+++ b/usr.sbin/smtpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.7 2009/01/04 22:35:09 gilles Exp $ */
+/* $OpenBSD: control.c,v 1.8 2009/01/27 14:32:19 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -225,6 +225,7 @@ control_accept(int listenfd, short event, void *arg)
imsg_init(&c->ibuf, connfd, control_dispatch_ext);
c->ibuf.events = EV_READ;
+ c->ibuf.data = env;
event_set(&c->ibuf.ev, c->ibuf.fd, c->ibuf.events,
c->ibuf.handler, env);
event_add(&c->ibuf.ev, NULL);