aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ssh.c
diff options
context:
space:
mode:
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2008-07-29 17:29:09 +0000
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2008-07-29 17:29:09 +0000
commit2a029b6e4b8fe24be0a5599e5c815a7d863fb403 (patch)
tree4ec632e29dfdff5de7cc68e2f0c0d4e53e58548b /epan/dissectors/packet-ssh.c
parentc7e1be2b1e1583bd399bfeb1f8c7aa218738e4b7 (diff)
Make sure a struct is completely initialized before we try to use it. Fixes
bug 2751. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25861 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-ssh.c')
-rw-r--r--epan/dissectors/packet-ssh.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/epan/dissectors/packet-ssh.c b/epan/dissectors/packet-ssh.c
index 09fdd32cee..898721751e 100644
--- a/epan/dissectors/packet-ssh.c
+++ b/epan/dissectors/packet-ssh.c
@@ -107,7 +107,7 @@ struct ssh_flow_data {
gchar* enc_client_request;
gchar* enc_server_offer;
gchar* enc;
-
+
gchar* comp_client_request;
gchar* comp_server_offer;
gchar* comp;
@@ -262,21 +262,10 @@ dissect_ssh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
global_data = conversation_get_proto_data(conversation,proto_ssh);
if(!global_data ) {
- global_data = se_alloc(sizeof(struct ssh_flow_data));
- global_data->req_counter=0;
- global_data->rsp_counter=0;
+ global_data = se_alloc0(sizeof(struct ssh_flow_data));
global_data->version=SSH_VERSION_UNKNOWN;
-
- global_data->mac_client_request=NULL;
- global_data->mac_server_offer=NULL;
global_data->mac_length=-1;
- global_data->enc_client_request=NULL;
- global_data->enc_server_offer=NULL;
-
- global_data->comp_client_request=NULL;
- global_data->comp_server_offer=NULL;
-
conversation_add_proto_data(conversation,proto_ssh,global_data);
}
@@ -526,7 +515,7 @@ ssh_dissect_ssh1(tvbuff_t *tvb, packet_info *pinfo,
msg_code);
}
if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO,
+ col_append_str(pinfo->cinfo, COL_INFO,
val_to_str(msg_code, ssh1_msg_vals, "Unknown (%u)"));
}
offset += 1;
@@ -665,7 +654,7 @@ ssh_dissect_key_exchange(tvbuff_t *tvb, packet_info *pinfo,
}
if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO,
+ col_append_str(pinfo->cinfo, COL_INFO,
val_to_str(msg_code, ssh2_msg_vals, "Unknown (%u)"));
}
offset += 1;
@@ -703,7 +692,7 @@ ssh_dissect_key_exchange(tvbuff_t *tvb, packet_info *pinfo,
offset+=ssh_tree_add_string(tvb,offset,key_ex_tree,hf_ssh_kexdh_h_sig,hf_ssh_kexdh_h_sig_length);
}
}
-
+
len = plen+4-padding_length-(offset-last_offset);
if (tree ) {
ssh_proto_tree_add_item(key_ex_tree, hf_ssh_payload,