diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-06-21 15:01:41 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-06-21 15:01:41 +0000 |
commit | 2f4cad8d89b656684e8829b2e164070515d4d34b (patch) | |
tree | 243b95293e11d7a8968cb2412fbfacb5ece6c4ba /libc/locale | |
parent | dc798c87712902a115d067b099582c811d9f6951 (diff) |
Merge changes between r14014 and r14127 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@14282 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/locale')
-rw-r--r-- | libc/locale/findlocale.c | 5 | ||||
-rw-r--r-- | libc/locale/programs/locarchive.c | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/libc/locale/findlocale.c b/libc/locale/findlocale.c index 6b88c9634..2fec9a70d 100644 --- a/libc/locale/findlocale.c +++ b/libc/locale/findlocale.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc. +/* Copyright (C) 1996-2003, 2006, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -140,6 +140,9 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, */ mask = _nl_explode_name (loc_name, &language, &modifier, &territory, &codeset, &normalized_codeset); + if (mask == -1) + /* Memory allocate problem. */ + return NULL; /* If exactly this locale was already asked for we have an entry with the complete name. */ diff --git a/libc/locale/programs/locarchive.c b/libc/locale/programs/locarchive.c index 27d589b88..b4b409673 100644 --- a/libc/locale/programs/locarchive.c +++ b/libc/locale/programs/locarchive.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2002,2003,2005,2007,2009,2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -1080,6 +1080,8 @@ add_locale_to_archive (ah, name, data, replace) int mask = _nl_explode_name (strdupa (name), &language, &modifier, &territory, &codeset, &normalized_codeset); + if (mask == -1) + return -1; if (mask & XPG_NORM_CODESET) /* This name contains a codeset in unnormalized form. @@ -1129,6 +1131,7 @@ add_locale_to_archive (ah, name, data, replace) /* Now read the locale.alias files looking for lines whose right hand side matches our name after normalization. */ + int result = 0; if (alias_file != NULL) { FILE *fp; @@ -1208,6 +1211,11 @@ add_locale_to_archive (ah, name, data, replace) &rhs_territory, &rhs_codeset, &rhs_normalized_codeset); + if (rhs_mask == -1) + { + result = -1; + goto out; + } if (!strcmp (language, rhs_language) && ((rhs_mask & XPG_CODESET) /* He has a codeset, it must match normalized. */ @@ -1241,6 +1249,7 @@ add_locale_to_archive (ah, name, data, replace) } } + out: fclose (fp); } @@ -1249,7 +1258,7 @@ add_locale_to_archive (ah, name, data, replace) if (mask & XPG_NORM_CODESET) free ((char *) normalized_codeset); - return 0; + return result; } |