diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-06-10 18:28:22 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-06-10 18:28:22 +0000 |
commit | fdb5b1af02573c18ed69561b5df37c28d52745c1 (patch) | |
tree | e65858f3d7c94418724c01ed7fcaf69e7272738f /epan/dissectors/packet-iax2.c | |
parent | 7cae4a40d04a764d206bc9202a80b384a0ad920b (diff) |
just to get things straight: a dissector should *never* do any g_assert() calls!
in a simple approach, I've replaced all g_assert() and g_assert_not_reached() calls by their exception throwing counterparts DISSECTOR_ASSERT() and DISSECTOR_ASSERT_NOT_REACHED()
this will replace application crash by showing a dissector bug, which is the desired behaviour
there were some g_assert calls in the protocol registering functions, which might not be acting as expected now, but to be able to simply search for g_assert in the future I've replaced that calls too
one g_assert remained, the one when someone throws an unknown exception "into" packet_frame.c, but IMHO this one should remain.
svn path=/trunk/; revision=14608
Diffstat (limited to 'epan/dissectors/packet-iax2.c')
-rw-r--r-- | epan/dissectors/packet-iax2.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c index 36916d1bd3..c1ae493ff9 100644 --- a/epan/dissectors/packet-iax2.c +++ b/epan/dissectors/packet-iax2.c @@ -624,7 +624,7 @@ static iax_call_data *iax_lookup_circuit_details_from_dest( guint src_circuit_id /* there's no way we can create a CT_IAX2 circuit without adding iax call data to it; assert this */ - g_assert(iax_call); + DISSECTOR_ASSERT(iax_call); if( dst_circuit_id == iax_call -> forward_circuit_id ) { #ifdef DEBUG_HASHING @@ -691,7 +691,7 @@ static iax_call_data *iax_lookup_circuit_details_from_dest( guint src_circuit_id return NULL; } } else { - g_assert_not_reached(); + DISSECTOR_ASSERT_NOT_REACHED(); } @@ -702,7 +702,7 @@ static iax_call_data *iax_lookup_circuit_details_from_dest( guint src_circuit_id *circuit_p = find_circuit( CT_IAX2, src_circuit_id, framenum ); - g_assert(*circuit_p); + DISSECTOR_ASSERT(*circuit_p); } if( reversed_p ) @@ -764,7 +764,7 @@ static iax_call_data *iax_lookup_circuit_details( packet_info *pinfo, /* there's no way we can create a CT_IAX2 circuit without adding iax call data to it; assert this */ - g_assert(iax_call); + DISSECTOR_ASSERT(iax_call); if( src_circuit_id == iax_call -> forward_circuit_id ) reversed = FALSE; @@ -775,7 +775,7 @@ static iax_call_data *iax_lookup_circuit_details( packet_info *pinfo, without the circuit being either the forward or reverse circuit for that call; assert this too. */ - g_assert_not_reached(); + DISSECTOR_ASSERT_NOT_REACHED(); } } } |