From 350b4b34f460b91b8fa8f692cf6bc30d561a5711 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sun, 28 Jun 2020 13:36:57 +0100 Subject: [PATCH] Problem: test_security_zap occasionally segfaults Solution: check if a session's _pipe has been allocated before using it, since as a consequence of creating the pipes after the handshake it's no longer guaranteed to be there. Fixes #3971 --- src/session_base.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/session_base.cpp b/src/session_base.cpp index b7da4ccc71..551ae318f3 100644 --- a/src/session_base.cpp +++ b/src/session_base.cpp @@ -308,7 +308,8 @@ void zmq::session_base_t::read_activated (pipe_t *pipe_) } if (unlikely (_engine == NULL)) { - _pipe->check_read (); + if (_pipe) + _pipe->check_read (); return; }