diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-06-19 17:59:57 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-06-19 17:59:57 +1000 |
commit | 33789111241a1d97fc105ec4edd7b8054895b28c (patch) | |
tree | a27fd3f33c2d34802446a5e9139ec004cd773d73 | |
parent | 60c93b9777d9bd7dce89f9024ba767f5404ac72d (diff) | |
download | samba-33789111241a1d97fc105ec4edd7b8054895b28c.tar.gz samba-33789111241a1d97fc105ec4edd7b8054895b28c.tar.xz samba-33789111241a1d97fc105ec4edd7b8054895b28c.zip |
Fix segfault caused by talloc_free() being called while still processing
The problem here was that with the packet code set to serialise, we
can have multiple packets 'processing' at once, and previously the
second packet (allowed because we are spining on an event context down
the stack) would clear the flag.
Andrew Bartlett
-rw-r--r-- | source/smbd/service_stream.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/smbd/service_stream.c b/source/smbd/service_stream.c index e27d87ec750..f27560f6ee4 100644 --- a/source/smbd/service_stream.c +++ b/source/smbd/service_stream.c @@ -85,13 +85,13 @@ void stream_terminate_connection(struct stream_connection *srv_conn, const char */ static void stream_io_handler(struct stream_connection *conn, uint16_t flags) { - conn->processing = true; + conn->processing++; if (flags & EVENT_FD_WRITE) { conn->ops->send_handler(conn, flags); } else if (flags & EVENT_FD_READ) { conn->ops->recv_handler(conn, flags); } - conn->processing = false; + conn->processing--; if (conn->terminate) { stream_terminate_connection(conn, conn->terminate); |