packet.c: fix possible NULL pointer de-reference within listen_state
Fixes VS2012 code analysis warning C6011: dereferencing NULL pointer 'listen_state->channel'. libssh2 packet.c 221
This commit is contained in:
parent
1c1699545b
commit
e57f29f8f6
@ -218,9 +218,11 @@ packet_queue_listener(LIBSSH2_SESSION * session, unsigned char *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Link the channel into the end of the queue list */
|
/* Link the channel into the end of the queue list */
|
||||||
_libssh2_list_add(&listn->queue,
|
if (listen_state->channel) {
|
||||||
&listen_state->channel->node);
|
_libssh2_list_add(&listn->queue,
|
||||||
listn->queue_size++;
|
&listen_state->channel->node);
|
||||||
|
listn->queue_size++;
|
||||||
|
}
|
||||||
|
|
||||||
listen_state->state = libssh2_NB_state_idle;
|
listen_state->state = libssh2_NB_state_idle;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user