mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-10 06:23:01 +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->type = SSH_REQUEST_GLOBAL;
|
||||
|
||||
if(!strcmp(request, "tcpip-forward")) {
|
||||
if (request && strcmp(request, "tcpip-forward") == 0) {
|
||||
bind_addr_s = buffer_get_ssh_string(packet);
|
||||
if (bind_addr_s != NULL) {
|
||||
bind_addr = ssh_string_to_char(bind_addr_s);
|
||||
@@ -900,7 +900,7 @@ SSH_PACKET_CALLBACK(ssh_packet_global_request){
|
||||
} else {
|
||||
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);
|
||||
if (bind_addr_s != NULL) {
|
||||
bind_addr = ssh_string_to_char(bind_addr_s);
|
||||
|
Reference in New Issue
Block a user