src/FakeServer/doc/dissectors/packet-mysql.c
static int
mysql_field_add_lestring(tvbuff_t *tvb, int offset, proto_tree *tree, int field)
{
	guint64 lelen;
	guint8 is_null;

	offset += tvb_get_fle(tvb, offset, &lelen, &is_null);
	if(is_null)
		proto_tree_add_string(tree, field, tvb, offset, 4, "NULL");
	else
	{
		proto_tree_add_item(tree, field, tvb, offset, (int)lelen, ENC_NA);
		/* Prevent infinite loop due to overflow */
		if (offset + (int)lelen < offset) {
			offset = tvb_reported_length(tvb);
		}
		else {
			offset += (int)lelen;
		}
	}
	return offset;
}
/*
 * Add length encoded string to tree
 */
Add length encoded string to tree
Add length encoded string to tree
static int
mysql_field_add_lestring(tvbuff_t *tvb, int offset, proto_tree *tree, int field)
{
	guint64 lelen;
	guint8 is_null;
	offset += tvb_get_fle(tvb, offset, &lelen, &is_null);
	if(is_null)
		proto_tree_add_string(tree, field, tvb, offset, 4, "NULL");
	else
	{
		proto_tree_add_item(tree, field, tvb, offset, (int)lelen, ENC_NA);
		if (offset + (int)lelen < offset) {
			offset = tvb_reported_length(tvb);
		}
		else {
			offset += (int)lelen;
		}
	}
	return offset;
}
static int mysql_field_add_lestring ( tvbuff_t * tvb , int offset , proto_tree * tree , int field ) { guint64 lelen ; guint8 is_null ; offset += tvb_get_fle ( tvb , offset , & lelen , & is_null ) ; if ( is_null ) proto_tree_add_string ( tree , field , tvb , offset , 4 , " " ) ; else { proto_tree_add_item ( tree , field , tvb , offset , ( int ) lelen , ENC_NA ) ; if ( offset + ( int ) lelen < offset ) { offset = tvb_reported_length ( tvb ) ; } else { offset += ( int ) lelen ; } } return offset ; }
Add length encoded string to tree
Add length encoded string to tree
/* Prevent infinite loop due to overflow */