the maximum ASN OID length is 256 bytes and there is a define to control this.

fix bug251 and all other occurances where an oid string  passed to packet_ber_object_identifier()
is not defined as foo[MAX_OID_STR_LEN]

svn path=/trunk/; revision=14720
This commit is contained in:
Ronnie Sahlberg 2005-06-21 09:38:59 +00:00
parent 4af84b3d87
commit 33f4400f83
8 changed files with 19 additions and 10 deletions

View File

@ -80,7 +80,7 @@ static gint ett_acse = -1;
static struct SESSION_DATA_STRUCTURE* session = NULL;
static char object_identifier_id[64]; /*64 chars should be long enough? */
static char object_identifier_id[MAX_OID_STR_LEN];
/* indirect_reference, used to pick up the signalling so we know what
kind of data is transferred in SES_DATA_TRANSFER_PDUs */
static guint32 indir_ref=0;

View File

@ -134,14 +134,14 @@ else
offset+=len;
#.FN_BODY Applicationcontext
static char buffer[128];
static char buffer[MAX_OID_STR_LEN];
cur_oid = buffer;
pinfo->private_data = buffer;
offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
hf_index, cur_oid);
#.FN_BODY UserInfoOID
static char buffer[128];
static char buffer[MAX_OID_STR_LEN];
tcapext_oid = buffer;
pinfo->private_data = buffer;
offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,

View File

@ -236,7 +236,7 @@ static gint ett_acse_Authentication_value = -1;
static struct SESSION_DATA_STRUCTURE* session = NULL;
static char object_identifier_id[64]; /*64 chars should be long enough? */
static char object_identifier_id[MAX_OID_STR_LEN];
/* indirect_reference, used to pick up the signalling so we know what
kind of data is transferred in SES_DATA_TRANSFER_PDUs */
static guint32 indir_ref=0;

View File

@ -1,4 +1,7 @@
/* #define DEBUG_BER 1 */
/* TODO: dissect_ber_object_identifier() should take a char **value_string
* and let the caller strdup if required.
*/
/* TODO: change #.REGISTER signature to new_dissector_t and
* update call_ber_oid_callback() accordingly.
*/
@ -1215,7 +1218,10 @@ dissect_ber_GeneralString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, i
return offset;
}
/* 8.19 Encoding of an object identifier value */
/* 8.19 Encoding of an object identifier value.
* IF you pass a pointer for value_string to this one, MAKE SURE it is declared
* as char foo[MAX_OID_STR_LEN]
*/
int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, char *value_string) {
gint8 class;
gboolean pc;

View File

@ -134,6 +134,8 @@ extern int dissect_ber_GeneralString(packet_info *pinfo, proto_tree *tree, tvbuf
/* this function dissects a BER Object Identifier
* IF you pass a pointer for value_string to this one, MAKE SURE it is declared
* as char foo[MAX_OID_STR_LEN]
*/
extern int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, char *value_string);

View File

@ -43,6 +43,7 @@
#include <epan/dissectors/packet-frame.h>
#include "epan/conversation.h"
#include "packet-ber.h"
#include "to_str.h"
static int proto_gssapi = -1;
@ -123,7 +124,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gboolean pc, ind_field;
gint32 tag;
guint32 len1;
gchar oid[128]; /* should be enough */
gchar oid[MAX_OID_STR_LEN];
start_offset=0;
offset=start_offset;

View File

@ -1029,7 +1029,7 @@ dissect_spnego_mechTypes(tvbuff_t *tvb, int offset, packet_info *pinfo,
gboolean pc, ind_field;
gint32 tag;
gint32 len1;
gchar oid[128]; /* should be enough */
gchar oid[MAX_OID_STR_LEN];
start_offset=offset;
/*
@ -1824,7 +1824,7 @@ dissect_spnego_wrap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gboolean pc, ind_field;
gint32 tag;
guint32 len1;
gchar oid[128]; /* should be enough */
gchar oid[MAX_OID_STR_LEN];
start_offset=0;
offset=start_offset;

View File

@ -297,7 +297,7 @@ static int dissect_protocol_versionrq_impl(packet_info *pinfo, proto_tree *tree,
static int
dissect_tcap_Applicationcontext(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
static char buffer[128];
static char buffer[MAX_OID_STR_LEN];
cur_oid = buffer;
pinfo->private_data = buffer;
offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
@ -609,7 +609,7 @@ dissect_tcap_ExternalPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p
static int
dissect_tcap_UserInfoOID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
static char buffer[128];
static char buffer[MAX_OID_STR_LEN];
tcapext_oid = buffer;
pinfo->private_data = buffer;
offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,