]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
From glibc: 2007-07-11 Jakub Jelinek <jakub@redhat.com>
authorBruno Haible <bruno@clisp.org>
Sat, 13 Oct 2007 15:45:39 +0000 (15:45 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:15:16 +0000 (12:15 +0200)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/explodename.c
gettext-runtime/intl/finddomain.c

index dc182df0fd7bea478c67ef709c4dbc204608aca3..8f668ba338f37a37f3ed09b420055086cd54acb9 100644 (file)
@@ -1,3 +1,10 @@
+2007-07-11  Jakub Jelinek  <jakub@redhat.com>
+
+       * 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  <bruno@clisp.org>
 
        * printf-parse.c: Don't include config.h and the specification
index 8d3e1463d15f974566356fcb8620c5438f8a0690..eb5dd755c3c369866216f53e260cea5fd1349394 100644 (file)
@@ -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 <drepper@gnu.ai.mit.edu>, 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;
index a25bebcb9e69e5d83beee8f846dad5f546febd5d..97d098b27fe54ead52819becf05913813b7295c5 100644 (file)
@@ -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 <drepper@gnu.org>, 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);