mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-08 19:02:06 +03:00
channel: Fix a possible null pointer dereference.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user