about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-10-22 15:50:12 +0000
committerRoland McGrath <roland@gnu.org>2002-10-22 15:50:12 +0000
commit5e922099c61712176c8bd37f150ebe568c2a2476 (patch)
treeaaf1bcc76cc107e2a7ff95a0e85a3a215f806f91
parent8265947da0173ae415bed7123c64ad97bb2af1b5 (diff)
downloadglibc-5e922099c61712176c8bd37f150ebe568c2a2476.tar.gz
glibc-5e922099c61712176c8bd37f150ebe568c2a2476.tar.xz
glibc-5e922099c61712176c8bd37f150ebe568c2a2476.zip
* locale/programs/locarchive.c (enlarge_archive): Make sure
	string_size is always a multiple of 4.
	Reported by Andreas Schwab <schwab@suse.de>.
-rw-r--r--ChangeLog6
-rw-r--r--locale/programs/locarchive.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e712c98608..d5a1d2fafc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-10-22  Jakub Jelinek  <jakub@redhat.com>
+
+	* locale/programs/locarchive.c (enlarge_archive): Make sure
+	string_size is always a multiple of 4.
+	Reported by Andreas Schwab <schwab@suse.de>.
+
 2002-10-21  Roland McGrath  <roland@redhat.com>
 
 	* sysdeps/generic/libc-tls.c (__libc_setup_tls): Initialize the static
diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
index c7aa5b06ac..abb6cd28e1 100644
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -272,7 +272,10 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
   newhead.string_offset = (newhead.namehash_offset
 			   + (newhead.namehash_size
 			      * sizeof (struct namehashent)));
-  newhead.string_size = MAX (2 * newhead.string_used, newhead.string_size);
+  /* Keep the string table size aligned to 4 bytes, so that
+     all the struct { uint32_t } types following are happy.  */
+  newhead.string_size = MAX ((2 * newhead.string_used + 3) & -4,
+			     newhead.string_size);
 
   newhead.locrectab_offset = newhead.string_offset + newhead.string_size;
   newhead.locrectab_size = MAX (2 * newhead.locrectab_used,