From: Ted Lemon Date: Fri, 20 Apr 2001 20:14:07 +0000 (+0000) Subject: Don't allow writes on a closed connection. X-Git-Tag: V3-RC2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c1d58ae6ecdbaf69f63a838cde9644b4d0f9298f;p=thirdparty%2Fdhcp.git Don't allow writes on a closed connection. --- diff --git a/omapip/buffer.c b/omapip/buffer.c index 253da9e1f..d007a23a0 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)