From c1d58ae6ecdbaf69f63a838cde9644b4d0f9298f Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Fri, 20 Apr 2001 20:14:07 +0000 Subject: [PATCH] Don't allow writes on a closed connection. --- omapip/buffer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/omapip/buffer.c b/omapip/buffer.c index 253da9e1..d007a23a 100644 --- a/omapip/buffer.c +++ b/omapip/buffer.c @@ -292,6 +292,12 @@ isc_result_t omapi_connection_copyin (omapi_object_t *h, return ISC_R_INVALIDARG; c = (omapi_connection_object_t *)h; + /* If the connection is closed, return an error if the caller + tries to copy in. */ + if (c -> state == omapi_connection_disconnecting || + c -> state == omapi_connection_closed) + return ISC_R_NOTCONNECTED; + if (c -> outbufs) { for (buffer = c -> outbufs; buffer -> next; buffer = buffer -> next)