Ensure there's no exception during the initial heuristics test.

Change-Id: I7d7e8bf2d1d63b34659f6de506eb4b2693780cce
Reviewed-on: https://code.wireshark.org/review/649
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
This commit is contained in:
Bill Meier 2014-03-13 16:18:06 -04:00
parent eea31bee59
commit 740ec32af5
1 changed files with 7 additions and 10 deletions

View File

@ -50,7 +50,6 @@
void proto_register_jxta(void);
void proto_reg_handoff_jxta(void);
#define JXTA_UDP_MAGIC 0x4a5a5441 /* JXTA */
static const gchar JXTA_UDP_SIG[] = { 'J', 'X', 'T', 'A' };
static const gchar JXTA_MSG_SIG[] = { 'j', 'x', 'm', 'g' };
static const gchar JXTA_MSGELEM_SIG[] = { 'j', 'x', 'e', 'l' };
@ -171,8 +170,8 @@ static gint *const ett[] = {
* global preferences
**/
static gboolean gDESEGMENT = TRUE;
static gboolean gUDP_HEUR = TRUE;
static gboolean gTCP_HEUR = TRUE;
static gboolean gUDP_HEUR = TRUE;
static gboolean gTCP_HEUR = TRUE;
static gboolean gSCTP_HEUR = TRUE;
static gboolean gMSG_MEDIA = TRUE;
@ -230,11 +229,9 @@ static gboolean dissect_jxta_UDP_heur(tvbuff_t * tvb, packet_info * pinfo, proto
int save_desegment_offset;
guint32 save_desegment_len;
int ret;
guint32 magic;
magic = tvb_get_ntohl(tvb,0);
if(magic != JXTA_UDP_MAGIC){
/* Not a JXTA UDP packet. */
if (tvb_strneql(tvb, 0, JXTA_UDP_SIG, sizeof (JXTA_UDP_SIG)) != 0) {
/* Not a JXTA UDP packet (or not enough bytes to check for the sig) */
return FALSE;
}
@ -2337,9 +2334,9 @@ void proto_reg_handoff_jxta(void)
static dissector_handle_t message_jxta_handle;
static gboolean msg_media_register_done = FALSE;
static gboolean udp_register_done = FALSE;
static gboolean tcp_register_done = FALSE;
static gboolean sctp_register_done = FALSE;
static gboolean udp_register_done = FALSE;
static gboolean tcp_register_done = FALSE;
static gboolean sctp_register_done = FALSE;
if(!init_done) {
message_jxta_handle = new_create_dissector_handle(dissect_jxta_message, proto_message_jxta);