Skip to content

Commit

Permalink
Really don't crash if a connection closes early
Browse files Browse the repository at this point in the history
https://bugzilla.redhat.com/show_bug.cgi?id=1047577

When writing commit 173c291, I missed the fact virNetServerClientClose
unlocks the client object before actually clearing client->sock and thus
it is possible to hit a window when client->keepalive is NULL while
client->sock is not NULL. I was thinking client->sock == NULL was a
better check for a closed connection but apparently we have to go with
client->keepalive == NULL to actually fix the crash.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
  • Loading branch information
jirkade committed Jan 13, 2014
1 parent fbe472d commit 066c8ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rpc/virnetserverclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ virNetServerClientStartKeepAlive(virNetServerClientPtr client)
/* The connection might have been closed before we got here and thus the
* keepalive object could have been removed too.
*/
if (!client->sock) {
if (!client->keepalive) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("connection not open"));
goto cleanup;
Expand Down

0 comments on commit 066c8ef

Please sign in to comment.