From 31df69753f1b8a31163c338ae5d4eb908067aa51 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 24 Feb 2000 05:47:54 +0000 Subject: [PATCH] (allocate_arrays): Make sure the end of width table is 4-byte aligned. --- locale/programs/ld-ctype.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c index b36d313ec3f..2d63c2c31eb 100644 --- a/locale/programs/ld-ctype.c +++ b/locale/programs/ld-ctype.c @@ -1433,6 +1433,7 @@ allocate_arrays (struct locale_ctype_t *ctype, struct charset_t *charset) value for TABSIZE * N, where TABSIZE >= 256. */ size_t min_total = UINT_MAX; size_t act_size = 256; + size_t width_table_size; if (!be_quiet) fputs (_("\ @@ -1636,8 +1637,9 @@ Computing table size for character classes might take a while..."), /* Array for width information. Because the expected width are very small we use only one single byte. This save space and we need not provide the information twice with both endianesses. */ - ctype->width = (unsigned char *) xmalloc (ctype->plane_size - * ctype->plane_cnt); + width_table_size = (ctype->plane_size * ctype->plane_cnt + 3) & ~3ul; + ctype->width = (unsigned char *) xmalloc (width_table_size); + /* Initialize with default width value. */ memset (ctype->width, charset->width_default, ctype->plane_size * ctype->plane_cnt); -- 2.47.3