fix NULL dereference when window adjusting a non-existing channel
Suyog Jadhav pointed out that when receiving a window adjust to a channel not found, the code would reference a NULL pointer. Now it will instead output a message about that fact.
Этот коммит содержится в:
родитель
5456163507
Коммит
6d4b1bbb45
@ -861,12 +861,16 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
|
||||
if (session->packAdd_channel && bytestoadd) {
|
||||
session->packAdd_channel->local.window_size += bytestoadd;
|
||||
}
|
||||
if(session->packAdd_channel)
|
||||
_libssh2_debug(session, LIBSSH2_TRACE_CONN,
|
||||
"Window adjust received for channel %lu/%lu, adding %lu bytes, new window_size=%lu",
|
||||
session->packAdd_channel->local.id,
|
||||
session->packAdd_channel->remote.id,
|
||||
bytestoadd,
|
||||
session->packAdd_channel->local.window_size);
|
||||
else
|
||||
_libssh2_debug(session, LIBSSH2_TRACE_CONN,
|
||||
"Window adjust for non-existing channel!");
|
||||
|
||||
LIBSSH2_FREE(session, data);
|
||||
session->packAdd_state = libssh2_NB_state_idle;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user