aboutsummaryrefslogtreecommitdiff
path: root/src/messages.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2011-01-06 09:48:30 +0100
committerAndreas Schneider <asn@cynapses.org>2011-01-06 10:04:12 +0100
commit13ece2a2f81dfa1bddffbbe40001e8470060e455 (patch)
tree09ce810a527f0c6f29805079d404fe8ce26cfe89 /src/messages.c
parente57d5a45b93c4f59c83d159244d26e68512f59f2 (diff)
downloadlibssh-13ece2a2f81dfa1bddffbbe40001e8470060e455.tar.gz
libssh-13ece2a2f81dfa1bddffbbe40001e8470060e455.tar.xz
libssh-13ece2a2f81dfa1bddffbbe40001e8470060e455.zip
messages: Added missing NULL pointer checks.
Found by clang-analyzer http://test.libssh.org/clang-analyzer/
Diffstat (limited to 'src/messages.c')
-rw-r--r--src/messages.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/messages.c b/src/messages.c
index cee97637..48e1acb5 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -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);