From 5f760687a4e81edf3dc4011129688a2eddf8b697 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Wed, 9 Aug 2017 22:07:33 +0200 Subject: Handle possible SEGV at client_close --- src/proxy.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/proxy.cc') diff --git a/src/proxy.cc b/src/proxy.cc index bec4924..97180ca 100644 --- a/src/proxy.cc +++ b/src/proxy.cc @@ -572,7 +572,12 @@ void ProxyImpl::close_client(size_t index) { auto& client = clients_[index]; if (client.pkg_id != 0) { size_t avail; - auto ptr = client.in->read_ptr(&avail); + void const* ptr; + if (client.in) { + ptr = client.in->read_ptr(&avail); + } else { + avail = 0; + } if (avail) { send_attached_data(client.pkg_id, ptr, avail, true); } else { -- cgit v1.2.3-70-g09d2