diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2012-10-05 11:16:03 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2012-10-05 11:47:35 +0200 |
commit | 3eac8e1c1865a16a2fb7b029b9ad8e4a77fac154 (patch) | |
tree | 4c251952c047dd773dab8ed5c6200073e9b2f749 | |
parent | dc8f0cddeef7323f7ff936e1db76449ed23e5675 (diff) | |
download | libssh-3eac8e1c1865a16a2fb7b029b9ad8e4a77fac154.tar.gz libssh-3eac8e1c1865a16a2fb7b029b9ad8e4a77fac154.tar.xz libssh-3eac8e1c1865a16a2fb7b029b9ad8e4a77fac154.zip |
channels: Fix a possible null pointer dereference.
(cherry picked from commit 656fd60110b73b3fc56c8c407b12a68be7ca67ff)
-rw-r--r-- | src/channels.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/channels.c b/src/channels.c index 6b7abb61..871e1401 100644 --- a/src/channels.c +++ b/src/channels.c @@ -1495,11 +1495,16 @@ error: */ int ssh_channel_request_pty_size(ssh_channel channel, const char *terminal, int col, int row) { - ssh_session session = channel->session; + ssh_session session; ssh_string term = NULL; ssh_buffer buffer = NULL; int rc = SSH_ERROR; + if (channel == NULL) { + return SSH_ERROR; + } + session = channel->session; + enter_function(); #ifdef WITH_SSH1 if (channel->version==1) { |