aboutsummaryrefslogtreecommitdiffstats
path: root/print.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-12-08 21:57:25 +0000
committerGuy Harris <guy@alum.mit.edu>2003-12-08 21:57:25 +0000
commit0519141ac950ea3c6dae67f19c4a4ad0cbdd91d8 (patch)
treecde9258d9442bd98089f7046800ed0169b38aa66 /print.c
parentd06dc0727a5a4d8e952a96ea275190a8298d725b (diff)
"proto_construct_dfilter_string()" can return a null pointer, e.g. for
protocol tree fields that don't have values and that are zero-length. Combine the "if (fi->hfinfo->type != FT_PROTOCOL && fi->length > 0)" stuff to show the raw value into the previous "if". svn path=/trunk/; revision=9210
Diffstat (limited to 'print.c')
-rw-r--r--print.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/print.c b/print.c
index 7e40e0e1fb..e016b4a20b 100644
--- a/print.c
+++ b/print.c
@@ -1,7 +1,7 @@
/* print.c
* Routines for printing packet analysis trees.
*
- * $Id: print.c,v 1.64 2003/12/06 06:09:10 gram Exp $
+ * $Id: print.c,v 1.65 2003/12/08 21:57:25 guy Exp $
*
* Gilbert Ramirez <gram@alumni.rice.edu>
*
@@ -329,24 +329,26 @@ proto_tree_print_node_pdml(proto_node *node, gpointer data)
* fvalue_to_string_repr() for *all* FT_* types. */
dfilter_string = proto_construct_dfilter_string(fi,
pdata->edt);
- chop_len = strlen(fi->hfinfo->abbrev) + 4; /* for " == " */
-
- /* XXX - Remove double-quotes. Again, once we can call
- * fvalue_to_string_repr(), we can ask it not to
- * produce the version for display-filters, and thus,
- * no double-quotes. */
- if (dfilter_string[strlen(dfilter_string)-1] == '"') {
- dfilter_string[strlen(dfilter_string)-1] = '\0';
- chop_len++;
+ if (dfilter_string != NULL) {
+ chop_len = strlen(fi->hfinfo->abbrev) + 4; /* for " == " */
+
+ /* XXX - Remove double-quotes. Again, once we
+ * can call fvalue_to_string_repr(), we can
+ * ask it not to produce the version for
+ * display-filters, and thus, no
+ * double-quotes. */
+ if (dfilter_string[strlen(dfilter_string)-1] == '"') {
+ dfilter_string[strlen(dfilter_string)-1] = '\0';
+ chop_len++;
+ }
+
+ fputs("\" show=\"", pdata->fh);
+ print_escaped_xml(pdata->fh, &dfilter_string[chop_len]);
+ }
+ if (fi->length > 0) {
+ fputs("\" value=\"", pdata->fh);
+ print_field_hex_value(pdata, fi);
}
-
- fputs("\" show=\"", pdata->fh);
- print_escaped_xml(pdata->fh, &dfilter_string[chop_len]);
- }
-
- if (fi->hfinfo->type != FT_PROTOCOL && fi->length > 0) {
- fputs("\" value=\"", pdata->fh);
- print_field_hex_value(pdata, fi);
}
if (node->first_child != NULL) {