about summary refs log tree commit diff
path: root/locale
diff options
context:
space:
mode:
authorOndřej Bílka <neleai@seznam.cz>2014-12-16 00:09:32 +0100
committerOndřej Bílka <neleai@seznam.cz>2014-12-16 00:09:50 +0100
commit363a98991884a744e78b9bfc7df89768901c0816 (patch)
tree65488a5dff0f56df964148365988692b815709d0 /locale
parentd52c62df3d7574906dde1dea23f8a71e85073b06 (diff)
downloadglibc-363a98991884a744e78b9bfc7df89768901c0816.tar.gz
glibc-363a98991884a744e78b9bfc7df89768901c0816.tar.xz
glibc-363a98991884a744e78b9bfc7df89768901c0816.zip
Return allocated array instead of unallocated.
In locale/programs/ld-ctype.c we returned array that was on stack.
Fixed by returning static array instead.
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/ld-ctype.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index 67846b398a..b2e8c82b1f 100644
--- a/locale/programs/ld-ctype.c
+++ b/locale/programs/ld-ctype.c
@@ -114,6 +114,9 @@ struct translit_include_t
   struct translit_include_t *next;
 };
 
+/* Provide some dummy pointer for empty string.  */
+static uint32_t no_str[] = { 0 };
+
 
 /* Sparse table of uint32_t.  */
 #define TABLE idx_table
@@ -1777,7 +1780,7 @@ find_translit2 (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
 
 	  for (wi = tirunp->from; wi <= wch; wi += tirunp->step)
 	    if (wi == wch)
-	      return (uint32_t []) { 0 };
+	      return no_str;
 	}
     }
 
@@ -1831,7 +1834,7 @@ read_widestring (struct linereader *ldfile, struct token *now,
 
   if (now->tok == tok_default_missing)
     /* The special name "" will denote this case.  */
-    wstr = ((uint32_t *) { 0 });
+    wstr = no_str;
   else if (now->tok == tok_bsymbol)
     {
       /* Get the value from the repertoire.  */
@@ -4090,12 +4093,9 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
     }
   else
     {
-      /* Provide some dummy pointers since we have nothing to write out.  */
-      static uint32_t no_str = { 0 };
-
-      ctype->translit_from_idx = &no_str;
-      ctype->translit_from_tbl = &no_str;
-      ctype->translit_to_tbl = &no_str;
+      ctype->translit_from_idx = no_str;
+      ctype->translit_from_tbl = no_str;
+      ctype->translit_to_tbl = no_str;
       ctype->translit_idx_size = 0;
       ctype->translit_from_tbl_size = 0;
       ctype->translit_to_tbl_size = 0;