From 341a2f503d3d5c71d83156b56c8c34135873c40e Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 21 Sep 2005 23:23:58 +0000 Subject: dissect_ber_octet_string() can return a null tvbuff pointer, if the putative octet string isn't one; always check before using it to dissect, and don't call the dissector if the tvbuff is null. This should fix bug 472. svn path=/trunk/; revision=15946 --- asn1/spnego/spnego.cnf | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'asn1/spnego/spnego.cnf') diff --git a/asn1/spnego/spnego.cnf b/asn1/spnego/spnego.cnf index b57161c310..1ebd727d5e 100644 --- a/asn1/spnego/spnego.cnf +++ b/asn1/spnego/spnego.cnf @@ -101,14 +101,11 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC %(DEFAULT_BODY)s - if (! mechToken_tvb) { - THROW(ReportedBoundsError); - } - /* - * Now, we should be able to dispatch after creating a new TVB. + * Now, we should be able to dispatch, if we've gotten a tvbuff for + * the token and we have information on how to dissect its contents. */ - if (next_level_value) + if (mechToken_tvb && next_level_value) call_dissector(next_level_value->handle, mechToken_tvb, pinfo, tree); @@ -145,7 +142,7 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC /* * Now, we should be able to dispatch with that tvbuff. */ - if (next_level_value) + if (mechListMIC_tvb && next_level_value) call_dissector(next_level_value->handle, mechListMIC_tvb, pinfo, tree); return offset; } @@ -187,12 +184,13 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC /* - * Now, we should be able to dispatch with that tvbuff. + * Now, we should be able to dispatch, if we've gotten a tvbuff for + * the token and we have information on how to dissect its contents. * However, we should make sure that there is something in the * response token ... */ - if (tvb_reported_length(responseToken_tvb) > 0) { - if (next_level_value) + if (responseToken_tvb && next_level_value) { + if (tvb_reported_length(responseToken_tvb) > 0) call_dissector(next_level_value->handle, responseToken_tvb, pinfo, tree); } @@ -210,9 +208,10 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC /* - * Now, we should be able to dispatch with that tvbuff. + * Now, we should be able to dispatch, if we've gotten a tvbuff for + * the MIC and we have information on how to dissect its contents. */ - if (next_level_value) + if (mechListMIC_tvb && next_level_value) call_dissector(next_level_value->handle, mechListMIC_tvb, pinfo, tree); -- cgit v1.2.3