Don't try to fill in last_dn if it doesn't exist. Fixes the current Buildbot

failure.

svn path=/trunk/; revision=17337
This commit is contained in:
Gerald Combs 2006-02-17 16:35:45 +00:00
parent 0b2d1add6f
commit d3f60e495b
2 changed files with 24 additions and 18 deletions

View File

@ -202,13 +202,16 @@ DistinguishedName B "2.5.4.49" "id-at-distinguishedName"
proto_item_append_text(top_of_rdn, " (%%s)", last_rdn);
/* now append this to the DN */
if(*last_dn) {
temp_dn = ep_alloc(MAX_DN_STR_LEN); /* is there a better way to use ep_alloc here ? */
g_snprintf(temp_dn, MAX_DN_STR_LEN, "%%s,%%s", last_rdn, last_dn);
last_dn[0] = '\0';
g_strlcat(last_dn, temp_dn, MAX_DN_STR_LEN);
} else
g_strlcat(last_dn, last_rdn, MAX_DN_STR_LEN);
if (last_dn) {
if(*last_dn) {
temp_dn = ep_alloc(MAX_DN_STR_LEN); /* is there a better way to use ep_alloc here ? */
g_snprintf(temp_dn, MAX_DN_STR_LEN, "%%s,%%s", last_rdn, last_dn);
last_dn[0] = '\0';
g_strlcat(last_dn, temp_dn, MAX_DN_STR_LEN);
} else {
g_strlcat(last_dn, last_rdn, MAX_DN_STR_LEN);
}
}
doing_dn = FALSE;
last_rdn = NULL; /* it will get freed when the next packet is dissected */

View File

@ -785,7 +785,7 @@ static const ber_sequence_t AttributeValueAssertion_sequence[] = {
int
dissect_x509if_AttributeValueAssertion(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
#line 264 "x509if.cnf"
#line 267 "x509if.cnf"
ava_hf_index = hf_index;
last_ava = ep_alloc(MAX_AVA_STR_LEN); *last_ava = '\0';
@ -887,7 +887,7 @@ dissect_x509if_AttributeTypeAndDistinguishedValue(gboolean implicit_tag _U_, tvb
static int
dissect_x509if_RelativeDistinguishedName_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
#line 217 "x509if.cnf"
#line 220 "x509if.cnf"
if(!rdn_one_value) {
top_of_rdn = tree;
@ -934,13 +934,16 @@ dissect_x509if_RelativeDistinguishedName(gboolean implicit_tag _U_, tvbuff_t *tv
proto_item_append_text(top_of_rdn, " (%s)", last_rdn);
/* now append this to the DN */
if(*last_dn) {
temp_dn = ep_alloc(MAX_DN_STR_LEN); /* is there a better way to use ep_alloc here ? */
g_snprintf(temp_dn, MAX_DN_STR_LEN, "%s,%s", last_rdn, last_dn);
last_dn[0] = '\0';
g_strlcat(last_dn, temp_dn, MAX_DN_STR_LEN);
} else
g_strlcat(last_dn, last_rdn, MAX_DN_STR_LEN);
if (last_dn) {
if(*last_dn) {
temp_dn = ep_alloc(MAX_DN_STR_LEN); /* is there a better way to use ep_alloc here ? */
g_snprintf(temp_dn, MAX_DN_STR_LEN, "%s,%s", last_rdn, last_dn);
last_dn[0] = '\0';
g_strlcat(last_dn, temp_dn, MAX_DN_STR_LEN);
} else {
g_strlcat(last_dn, last_rdn, MAX_DN_STR_LEN);
}
}
doing_dn = FALSE;
last_rdn = NULL; /* it will get freed when the next packet is dissected */
@ -954,7 +957,7 @@ dissect_x509if_RelativeDistinguishedName(gboolean implicit_tag _U_, tvbuff_t *tv
static int
dissect_x509if_RDNSequence_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
#line 253 "x509if.cnf"
#line 256 "x509if.cnf"
if(!dn_one_rdn) {
/* this is the first element - record the top */
@ -981,7 +984,7 @@ static const ber_sequence_t RDNSequence_sequence_of[1] = {
int
dissect_x509if_RDNSequence(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
#line 232 "x509if.cnf"
#line 235 "x509if.cnf"
const char *fmt;
dn_one_rdn = FALSE; /* reset */