Fix some uninitialized variable warnings reported in bug 8904 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8904) by setting conversation structure (smtp_session_state) to all zeros.

svn path=/trunk/; revision=50472
This commit is contained in:
Michael Mann 2013-07-09 20:35:26 +00:00
parent 678913dd09
commit 38ce891424
1 changed files with 1 additions and 11 deletions

View File

@ -403,20 +403,10 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* No - create one and attach it.
*/
session_state = (struct smtp_session_state *)wmem_alloc(wmem_file_scope(), sizeof(struct smtp_session_state));
session_state = (struct smtp_session_state *)wmem_alloc0(wmem_file_scope(), sizeof(struct smtp_session_state));
session_state->smtp_state = SMTP_STATE_READING_CMDS;
session_state->auth_state = SMTP_AUTH_STATE_NONE;
session_state->first_auth_frame = 0;
session_state->last_auth_frame = 0;
session_state->username_frame = 0;
session_state->password_frame = 0;
session_state->crlf_seen = FALSE;
session_state->data_seen = FALSE;
session_state->msg_read_len = 0;
session_state->msg_tot_len = 0;
session_state->msg_last = TRUE;
session_state->last_nontls_frame = 0;
session_state->username_cmd_frame = 0;
conversation_add_proto_data(conversation, proto_smtp, session_state);
}