{ AIM_CLIENT_TLV_LOCAL_PERSONAL_ALERT, "Personal Alert for Buddy", dissect_aim_tlv_value_uint16 },
{ AIM_CLIENT_TLV_LOCAL_PERSONAL_SOUND, "Personal Sound for Buddy", dissect_aim_tlv_value_string },
{ AIM_CLIENT_TLV_FIRST_MESSAGE_SENT, " First Time Message Sent to Buddy (Unix Timestamp)", dissect_aim_tlv_value_uint32 },
- { 0, "Unknown", NULL },
+ { 0, NULL, NULL },
};
{ AIM_ONLINEBUDDY_SESSIONLEN, "Session Length (sec)", dissect_aim_tlv_value_uint32 },
{ AIM_ONLINEBUDDY_ICQSESSIONLEN, "ICQ Session Length (sec)", dissect_aim_tlv_value_uint32 },
{ AIM_ONLINEBUDDY_AVAILMSG, "Available Message", dissect_aim_tlv_value_bytes },
- { 0, "Unknown", NULL }
+ { 0, NULL, NULL }
};
#define DC_DISABLED 0x0000
const aim_tlv motd_tlvs[] = {
{ AIM_MOTD_TLV_MOTD, "Message of the day message", dissect_aim_tlv_value_string },
- { 0, "Unknown", NULL }
+ { 0, NULL, NULL }
};
#define CLASS_UNCONFIRMED 0x0001
static const aim_tlv fnac_tlvs[] = {
{ FNAC_TLV_FAMILY_VERSION, "SNAC Family Version", dissect_aim_tlv_value_uint16 },
- { 0, "Unknown", NULL }
+ { 0, NULL, NULL }
};
static int dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
int dissect_aim_snac_error(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *aim_tree)
{
- char *name;
+ const char *name;
+
if ((name = match_strval(tvb_get_ntohs(tvb, 0), aim_snac_errors)) != NULL) {
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, name);
int dissect_aim_userinfo(tvbuff_t *tvb, packet_info *pinfo,
int offset, proto_tree *tree)
{
- offset = dissect_aim_buddyname(tvb, pinfo, offset, tree);
+ offset = dissect_aim_buddyname(tvb, pinfo, offset, tree);
proto_tree_add_item(tree, hf_aim_userinfo_warninglevel, tvb, offset, 2, FALSE);
offset += 2;
- return dissect_aim_tlv_list(tvb, pinfo, offset, tree, onlinebuddy_tlvs);
+ return dissect_aim_tlv_list(tvb, pinfo, offset, tree, onlinebuddy_tlvs);
}
int dissect_aim_fnac_flags(tvbuff_t *tvb, int offset, int len, proto_item *ti, guint16 flags)
proto_tree *tree)
{
guint8 buddyname_length = 0;
- char *buddyname;
proto_item *ti = NULL;
proto_tree *buddy_tree = NULL;
buddyname_length = tvb_get_guint8(tvb, offset);
offset++;
- buddyname = tvb_get_string(tvb, offset, buddyname_length);
if(tree) {
ti = proto_tree_add_text(tree, tvb, offset-1, 1+buddyname_length,
"Buddy: %s",
- format_text(buddyname, buddyname_length));
+ tvb_format_text(tvb, offset, buddyname_length));
buddy_tree = proto_item_add_subtree(ti, ett_aim_buddyname);
+ proto_tree_add_item(buddy_tree, hf_aim_buddyname_len, tvb, offset-1, 1, FALSE);
+ proto_tree_add_item(buddy_tree, hf_aim_buddyname, tvb, offset, buddyname_length, FALSE);
}
- proto_tree_add_item(buddy_tree, hf_aim_buddyname_len, tvb, offset-1, 1, FALSE);
- proto_tree_add_item(buddy_tree, hf_aim_buddyname, tvb, offset, buddyname_length, FALSE);
return offset+buddyname_length;
}
/* Block length (includes charset and charsubset) */
blocklen = tvb_get_ntohs(tvb, offset);
+ if (blocklen <= 4) {
+ proto_tree_add_text(entry, tvb, offset, 2, "Invalid block length: %d",
+ blocklen);
+ break;
+ }
proto_tree_add_item(entry, hf_aim_messageblock_len, tvb, offset, 2,
FALSE);
offset += 2;
guint16 length;
int i = 0;
const aim_tlv *tmp;
+ const char *desc;
proto_item *ti1;
proto_tree *tlv_tree;
int orig_offset;
if (tree) {
offset = orig_offset;
+
+ if (tmp[i].desc != NULL)
+ desc = tmp[i].desc;
+ else
+ desc = "Unknown";
- ti1 = proto_tree_add_text(tree, tvb, offset, length + 4, "TLV: %s", tmp[i].desc);
+ ti1 = proto_tree_add_text(tree, tvb, offset, length + 4, "TLV: %s", desc);
tlv_tree = proto_item_add_subtree(ti1, ett_aim_tlv);
proto_tree_add_text(tlv_tree, tvb, offset, 2,
- "Value ID: %s (0x%04x)", tmp[i].desc, valueid);
+ "Value ID: %s (0x%04x)", desc, valueid);
offset += 2;
proto_tree_add_text(tlv_tree, tvb, offset, 2,