added missing check for ssl_connection that would cause crash when the ssl connection gets closed by another thread

This commit is contained in:
Cyril Soler 2016-05-11 10:00:20 -04:00
parent 8fdf8f81a8
commit e891e2be2e

View File

@ -1622,6 +1622,10 @@ int pqissl::readdata(void *data, int len)
#ifdef PQISSL_DEBUG
std::cout << "Reading data thread=" << pthread_self() << ", ssl=" << (void*)this << std::endl ;
#endif
// safety check. Apparently this avoids some SIGSEGV.
//
if(ssl_connection == NULL)
return -1;
// There is a do, because packets can be splitted into multiple ssl buffers
// when they are larger than 16384 bytes. Such packets have to be read in