Fixed the order of the check in the BLOCK_ADJUST() macro so that it also works
for libssh2_session_free()
This commit is contained in:
@@ -1241,7 +1241,9 @@ int _libssh2_pem_decode_integer(unsigned char **data, unsigned int *datalen,
|
|||||||
#define BLOCK_ADJUST(rc,sess,x) \
|
#define BLOCK_ADJUST(rc,sess,x) \
|
||||||
do { \
|
do { \
|
||||||
rc = x; \
|
rc = x; \
|
||||||
if(!sess->api_block_mode || (rc != LIBSSH2_ERROR_EAGAIN)) \
|
/* the order of the check below is important to properly deal with the
|
||||||
|
case when the 'sess' is freed */ \
|
||||||
|
if((rc != LIBSSH2_ERROR_EAGAIN) || !sess->api_block_mode) \
|
||||||
break; \
|
break; \
|
||||||
rc = _libssh2_wait_socket(sess); \
|
rc = _libssh2_wait_socket(sess); \
|
||||||
if(rc) \
|
if(rc) \
|
||||||
|
Reference in New Issue
Block a user