summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/channels.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/channels.c b/src/channels.c
index 871e1401..221ce8e2 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -2277,11 +2277,16 @@ 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;
+ if (channel == NULL) {
+ return SSH_ERROR;
+ }
+ session = channel->session;
+
enter_function();
buffer_reinit(buffer);
if(count==0){