Control: tags = patch upstream

Hi,

I found that the problem is in a C file which is generated during build
(tmp-tt-table.c).  It contains some tables, and the last two elements
columsn of one table were not deterministic.
The reason is that the array is sized incorrectly.

It is declared as:

  unsigned int 
tag_tree_combination_table[TAG_TABLE_ROW_MAXIMUM][TAG_TABLE_COLUMN_MAXIMUM];

where TAG_TABLE_COLUMN_MAXIMUM was set to EXT_TAG_TABLE_COLS, which is 5.
But when calling this tool with -s, it uses STD_TAG_TABLE_COLUMNS for
iterating over the table, which is 7 -> two elements more than the table
is wide, which causes memory from outside the table to be written into
the file.

The attached patch fixes this by setting the maximum column width to
STD_TAG_TABLE_COLUMNS.

Kind regards,
  Reiner
diff --git a/dwarfdump/tag_common.h b/dwarfdump/tag_common.h
index f6c8aa7..0322e72 100644
--- a/dwarfdump/tag_common.h
+++ b/dwarfdump/tag_common.h
@@ -88,7 +88,7 @@ No blank lines or commentary allowed, no symbols, just numbers.
 
 /* The following 2 used in tag_tree.c only. */
 #define TAG_TABLE_ROW_MAXIMUM STD_TAG_TABLE_ROWS
-#define TAG_TABLE_COLUMN_MAXIMUM  EXT_TAG_TABLE_COLS
+#define TAG_TABLE_COLUMN_MAXIMUM  STD_TAG_TABLE_COLUMNS
 
 /*  Number of attributes columns per tag. The array is bit fields,
     BITS_PER_WORD fields per word. Dense and quick to inspect */

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to