From a446f39e20893bfc7857fe2d004909af1ee7252d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 13 Oct 2007 15:45:39 +0000 Subject: From glibc: 2007-07-11 Jakub Jelinek --- gettext-runtime/intl/ChangeLog | 7 +++++++ gettext-runtime/intl/explodename.c | 6 ++++-- gettext-runtime/intl/finddomain.c | 5 ++++- 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'gettext-runtime') diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index dc182df..8f668ba 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,10 @@ +2007-07-11 Jakub Jelinek + + * finddomain.c (_nl_find_domain): If _nl_explode_name returned -1, + return NULL. + * explodename.c (_nl_explode_name): Return -1 if _nl_normalize_codeset + failed. + 2007-06-10 Bruno Haible * printf-parse.c: Don't include config.h and the specification diff --git a/gettext-runtime/intl/explodename.c b/gettext-runtime/intl/explodename.c index 8d3e146..eb5dd75 100644 --- a/gettext-runtime/intl/explodename.c +++ b/gettext-runtime/intl/explodename.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-1998, 2000-2001, 2003, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1995-1998, 2000-2001, 2003, 2005, 2007 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it @@ -105,7 +105,9 @@ _nl_explode_name (char *name, { *normalized_codeset = _nl_normalize_codeset (*codeset, cp - *codeset); - if (strcmp (*codeset, *normalized_codeset) == 0) + if (*normalized_codeset == NULL) + return -1; + else if (strcmp (*codeset, *normalized_codeset) == 0) free ((char *) *normalized_codeset); else mask |= XPG_NORM_CODESET; diff --git a/gettext-runtime/intl/finddomain.c b/gettext-runtime/intl/finddomain.c index a25bebc..97d098b 100644 --- a/gettext-runtime/intl/finddomain.c +++ b/gettext-runtime/intl/finddomain.c @@ -1,5 +1,5 @@ /* Handle list of needed message catalogs - Copyright (C) 1995-1999, 2000-2001, 2003-2006 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000-2001, 2003-2007 Free Software Foundation, Inc. Written by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it @@ -144,6 +144,9 @@ _nl_find_domain (const char *dirname, char *locale, look for the language. Termination symbols are `_', '.', and `@'. */ mask = _nl_explode_name (locale, &language, &modifier, &territory, &codeset, &normalized_codeset); + if (mask == -1) + /* This means we are out of core. */ + return NULL; /* We need to protect modifying the _NL_LOADED_DOMAINS data. */ gl_rwlock_wrlock (lock); -- cgit v1.1