mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
messages: Added missing NULL pointer checks.
Found by clang-analyzer http://test.libssh.org/clang-analyzer/
This commit is contained in:
@@ -877,7 +877,7 @@ SSH_PACKET_CALLBACK(ssh_packet_global_request){
|
|||||||
msg = ssh_message_new(session);
|
msg = ssh_message_new(session);
|
||||||
msg->type = SSH_REQUEST_GLOBAL;
|
msg->type = SSH_REQUEST_GLOBAL;
|
||||||
|
|
||||||
if(!strcmp(request, "tcpip-forward")) {
|
if (request && strcmp(request, "tcpip-forward") == 0) {
|
||||||
bind_addr_s = buffer_get_ssh_string(packet);
|
bind_addr_s = buffer_get_ssh_string(packet);
|
||||||
if (bind_addr_s != NULL) {
|
if (bind_addr_s != NULL) {
|
||||||
bind_addr = ssh_string_to_char(bind_addr_s);
|
bind_addr = ssh_string_to_char(bind_addr_s);
|
||||||
@@ -900,7 +900,7 @@ SSH_PACKET_CALLBACK(ssh_packet_global_request){
|
|||||||
} else {
|
} else {
|
||||||
ssh_message_reply_default(msg);
|
ssh_message_reply_default(msg);
|
||||||
}
|
}
|
||||||
} else if(!strcmp(request, "cancel-tcpip-forward")) {
|
} else if (request && strcmp(request, "cancel-tcpip-forward") == 0) {
|
||||||
bind_addr_s = buffer_get_ssh_string(packet);
|
bind_addr_s = buffer_get_ssh_string(packet);
|
||||||
if (bind_addr_s != NULL) {
|
if (bind_addr_s != NULL) {
|
||||||
bind_addr = ssh_string_to_char(bind_addr_s);
|
bind_addr = ssh_string_to_char(bind_addr_s);
|
||||||
|
|||||||
Reference in New Issue
Block a user