diff options
Diffstat (limited to 'src/channels.c')
-rw-r--r-- | src/channels.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/channels.c b/src/channels.c index 1b7caa2f..6a81e377 100644 --- a/src/channels.c +++ b/src/channels.c @@ -2500,7 +2500,7 @@ error: */ int channel_read_buffer(ssh_channel channel, ssh_buffer buffer, uint32_t count, int is_stderr) { - ssh_session session=channel->session; + ssh_session session; char buffer_tmp[8192]; int r; uint32_t total=0; @@ -2508,6 +2508,8 @@ int channel_read_buffer(ssh_channel channel, ssh_buffer buffer, uint32_t count, if(channel == NULL) { return SSH_ERROR; } + session = channel->session; + if(buffer == NULL) { ssh_set_error_invalid(channel->session); return SSH_ERROR; |