1
0
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:
Andreas Schneider
2011-01-06 09:48:30 +01:00
parent e57d5a45b9
commit 13ece2a2f8

View File

@@ -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);