aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2017-07-21 00:07:31 +0200
committerAnders Broman <a.broman58@gmail.com>2017-07-24 07:02:55 +0000
commit7a4c9d267bd245f19796a5fea3b21b18ed57f870 (patch)
tree9326c495646f4661348f108505357fd40024cd44
parent877caf478bae1e7f64084a8f2a7d6fe61f63b5e9 (diff)
print: use assert before dereference (CID 1412973).
Change-Id: I82602ceb735a055602a18c2c52e0669c4efd7773 Reviewed-on: https://code.wireshark.org/review/22748 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/print.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/print.c b/epan/print.c
index 1b875ccd59..41b64ea4db 100644
--- a/epan/print.c
+++ b/epan/print.c
@@ -312,11 +312,13 @@ void
write_pdml_proto_tree(output_fields_t* fields, gchar **protocolfilter, pf_flags protocolfilter_flags, epan_dissect_t *edt, FILE *fh, gboolean use_color)
{
write_pdml_data data;
- const color_filter_t *cfp = edt->pi.fd->color_filter;
+ const color_filter_t *cfp;
g_assert(edt);
g_assert(fh);
+ cfp = edt->pi.fd->color_filter;
+
/* Create the output */
if (use_color && (cfp != NULL)) {
fprintf(fh, "<packet foreground='#%02x%02x%02x' background='#%02x%02x%02x'>\n",