From 6e607d847cc9ad50610238da03a92c4b01eb577a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 29 May 1998 12:03:44 +0000 Subject: Update. * locale/loadlocale.c (_nl_load_locale): Don't allow too small files crash the program. * string/Makefile: Don't run test on tst-svc.out if cross-compiling. --- ChangeLog | 6 ++++-- locale/loadlocale.c | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fbc1fbbdf1..a3f71f9c8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,10 @@ 1998-05-29 Ulrich Drepper + * locale/loadlocale.c (_nl_load_locale): Don't allow too small + files crash the program. + * io/Makefile: Don't run ftwtest-sh if cross-compiling. - * string/Makefile: Don't run test on tst/svc.out if - cross-compiling. + * string/Makefile: Don't run test on tst-svc.out if cross-compiling. Reported by Deborah Wallach . 1998-05-28 00:53 Zack Weinberg diff --git a/locale/loadlocale.c b/locale/loadlocale.c index 3ac161eb3a..d856063d52 100644 --- a/locale/loadlocale.c +++ b/locale/loadlocale.c @@ -1,5 +1,5 @@ /* Functions to read locale data files. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -160,6 +160,9 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) else goto puntfd; } + else if (st.st_size < sizeof (*filedata)) + /* This cannot be a locale data file since it's too small. */ + goto puntfd; if (filedata->magic == LIMAGIC (category)) /* Good data file in our byte order. */ -- cgit v1.2.3-70-g09d2