Make sure we initialize a TVB. Fixes bug 2329.

svn path=/trunk/; revision=24543
This commit is contained in:
Gerald Combs 2008-03-03 22:28:35 +00:00
parent af7d55655c
commit 7f097fdc9b
4 changed files with 19 additions and 13 deletions

View File

@ -295,11 +295,14 @@ XDayOf/fifth fifth_dayof
#.FN_PARS SyntaxBMPString VAL_PTR = &wide_tvb #.FN_PARS SyntaxBMPString VAL_PTR = &wide_tvb
#.FN_HDR SyntaxBMPString #.FN_HDR SyntaxBMPString
tvbuff_t *wide_tvb; tvbuff_t *wide_tvb = NULL;
char *string; char *string;
#.END #.END
#.FN_FTR SyntaxBMPString #.FN_FTR SyntaxBMPString
if (! wide_tvb) {
return offset;
}
string = tvb_get_ephemeral_faked_unicode (wide_tvb, 0, tvb_length(wide_tvb) / 2, FALSE); string = tvb_get_ephemeral_faked_unicode (wide_tvb, 0, tvb_length(wide_tvb) / 2, FALSE);
proto_item_append_text(actx->created_item, " %s", string); proto_item_append_text(actx->created_item, " %s", string);

View File

@ -37,11 +37,11 @@ Wireshark Info
<listitem> <listitem>
<para> <para>
Wireshark could crash at any moment. The X.509sat dissector could crash.
<!-- Fixed in r????? --> <!-- Fixed in r24543 -->
<!-- (Bug <ulink url="http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=???">???</ulink>) --> <!-- (Bug <ulink url="http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2329">2329</ulink>) -->
</para> </para>
<para>Versions affected: 0.2.0 to 0.99.7</para> <para>Versions affected: 0.99.5 to 0.99.8</para>
<para> <para>
<!-- <ulink url="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-????">CVE-2007-????</ulink> --> <!-- <ulink url="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-????">CVE-2007-????</ulink> -->
</para> </para>

View File

@ -1,7 +1,7 @@
/* Do not modify this file. */ /* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */ /* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-x509sat.c */ /* packet-x509sat.c */
/* ../../tools/asn2wrs.py -b -e -p x509sat -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn */ /* ../../tools/asn2wrs.py -b -e -p x509sat -c ./x509sat.cnf -s ./packet-x509sat-template -D . SelectedAttributeTypes.asn */
/* Input file: packet-x509sat-template.c */ /* Input file: packet-x509sat-template.c */
@ -1512,7 +1512,7 @@ dissect_x509sat_SyntaxIA5String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
static int static int
dissect_x509sat_SyntaxBMPString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { dissect_x509sat_SyntaxBMPString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 298 "x509sat.cnf" #line 298 "x509sat.cnf"
tvbuff_t *wide_tvb; tvbuff_t *wide_tvb = NULL;
char *string; char *string;
offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_BMPString, offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_BMPString,
@ -1520,6 +1520,9 @@ dissect_x509sat_SyntaxBMPString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
&wide_tvb); &wide_tvb);
#line 303 "x509sat.cnf" #line 303 "x509sat.cnf"
if (! wide_tvb) {
return offset;
}
string = tvb_get_ephemeral_faked_unicode (wide_tvb, 0, tvb_length(wide_tvb) / 2, FALSE); string = tvb_get_ephemeral_faked_unicode (wide_tvb, 0, tvb_length(wide_tvb) / 2, FALSE);
proto_item_append_text(actx->created_item, " %s", string); proto_item_append_text(actx->created_item, " %s", string);

View File

@ -1,7 +1,7 @@
/* Do not modify this file. */ /* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */ /* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-x509sat.h */ /* packet-x509sat.h */
/* ../../tools/asn2wrs.py -b -e -p x509sat -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn */ /* ../../tools/asn2wrs.py -b -e -p x509sat -c ./x509sat.cnf -s ./packet-x509sat-template -D . SelectedAttributeTypes.asn */
/* Input file: packet-x509sat-template.h */ /* Input file: packet-x509sat-template.h */