summaryrefslogtreecommitdiff
path: root/locale/loadlocale.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-30 05:57:47 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-30 05:57:47 +0000
commite43e0dd6b3ecdbf8980d0bfd47cea208ee8e9062 (patch)
treee7c5ff600da4e2968ba69861ddbf528af88d0c35 /locale/loadlocale.c
parent040cf4baf7c85c2c357e63f70935f86a90ab512d (diff)
downloadglibc-e43e0dd6b3ecdbf8980d0bfd47cea208ee8e9062.tar.gz
Update.
* locale/loadlocale.c (_nl_load_locale): Make sure all locale data used as words is properly aligned.
Diffstat (limited to 'locale/loadlocale.c')
-rw-r--r--locale/loadlocale.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index 54336c4c49..1478579c55 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -18,6 +18,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
@@ -215,7 +216,11 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
goto puntmap;
}
if (__builtin_expect (_nl_value_types[category][cnt] == word, 0))
- newdata->values[cnt].word = *((u_int32_t *) (newdata->filedata + idx));
+ {
+ assert (idx % 4 == 0);
+ newdata->values[cnt].word =
+ *((u_int32_t *) (newdata->filedata + idx));
+ }
else
newdata->values[cnt].string = newdata->filedata + idx;
}