]> sourceware.org Git - glibc.git/commitdiff
* locale/programs/locarchive.c (enlarge_archive): Make sure
authorRoland McGrath <roland@gnu.org>
Tue, 22 Oct 2002 15:50:12 +0000 (15:50 +0000)
committerRoland McGrath <roland@gnu.org>
Tue, 22 Oct 2002 15:50:12 +0000 (15:50 +0000)
string_size is always a multiple of 4.
Reported by Andreas Schwab <schwab@suse.de>.

ChangeLog
locale/programs/locarchive.c

index e712c98608c7ccbffef761f2eed7c6e176b9e8e7..d5a1d2fafc7b6b42461d9f96b7b6f4233e9d198e 100644 (file)
--- 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
index c7aa5b06ac507407deaacc1c090a365b2751d818..abb6cd28e16da32f01ad2302a72da843dd747534 100644 (file)
@@ -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,
This page took 0.042667 seconds and 5 git commands to generate.