Wireshark-dev: [Wireshark-dev] Bug 976
From: Martin Mathieson <martin.mathieson@xxxxxxxxxxxx>
Date: Tue, 27 Jun 2006 13:51:04 +0100
This bug doesn't cause a crash on my machine here (Suse 9.2).

Looking at frame 170 in the trace, it looks like tvb_get_ephemeral_text() struggles with the null character in the middle of the 4th parameter (in the WWW-Authenticate header) and returns NULL. The attached patch uses tvb_format_text() instead which also does a better job of showing the string.

Regards,
Martin
Index: epan/dissectors/packet-sip.c
===================================================================
--- epan/dissectors/packet-sip.c	(revision 18578)
+++ epan/dissectors/packet-sip.c	(working copy)
@@ -1087,8 +1087,8 @@
 	if (i == array_length(auth_parameters_hf_array))
 	{
 		proto_tree_add_text(tree, tvb, start_offset, current_offset-start_offset,
-		                    tvb_get_ephemeral_string(tvb, start_offset,
-		                                             current_offset-start_offset));
+		                    tvb_format_text(tvb, start_offset,
+		                                    current_offset-start_offset));
 	}
 
 	return current_offset;