From 5a0e69726d4a8cedb29e074d398f0ff29984524e Mon Sep 17 00:00:00 2001 From: Christof Hanke Date: Wed, 18 Nov 2015 14:02:50 +0100 Subject: [PATCH] tabular_output: allocate footer-line when set for the first time If the footer line is not allocated, programs segfault at runtime. The printFooter functions should check if the footer is allocated before printing them. Change-Id: Ib4066a67ee104be918811e178c0b7d7d33d790b8 Reviewed-on: http://gerrit.openafs.org/11753 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- src/util/tabular_output.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/tabular_output.c b/src/util/tabular_output.c index 6c053ccac..7c883a81b 100644 --- a/src/util/tabular_output.c +++ b/src/util/tabular_output.c @@ -90,6 +90,8 @@ util_setTableBodyRow(struct util_Table *Table, int RowIndex, char **Contents) { } int util_setTableFooter(struct util_Table * Table, char ** Contents) { + if (Table->Footer != NULL) + Table->Footer = newTableRow(Table); return do_setTableRow(Table,Table->Footer,Contents); } -- 2.39.5