mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-27 02:11:27 -05:00
added missing check for ssl_connection that would cause crash when the ssl connection gets closed by another thread
This commit is contained in:
parent
8fdf8f81a8
commit
e891e2be2e
@ -1622,6 +1622,10 @@ int pqissl::readdata(void *data, int len)
|
|||||||
#ifdef PQISSL_DEBUG
|
#ifdef PQISSL_DEBUG
|
||||||
std::cout << "Reading data thread=" << pthread_self() << ", ssl=" << (void*)this << std::endl ;
|
std::cout << "Reading data thread=" << pthread_self() << ", ssl=" << (void*)this << std::endl ;
|
||||||
#endif
|
#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
|
// 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
|
// when they are larger than 16384 bytes. Such packets have to be read in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user