arrfab / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1505500.patch

147e83
commit 363a98991884a744e78b9bfc7df89768901c0816
147e83
Author: Ondřej Bílka <neleai@seznam.cz>
147e83
Date:   Tue Dec 16 00:09:32 2014 +0100
147e83
147e83
    Return allocated array instead of unallocated.
147e83
    
147e83
    In locale/programs/ld-ctype.c we returned array that was on stack.
147e83
    Fixed by returning static array instead.
147e83
147e83
Index: b/locale/programs/ld-ctype.c
147e83
===================================================================
147e83
--- a/locale/programs/ld-ctype.c
147e83
+++ b/locale/programs/ld-ctype.c
147e83
@@ -113,6 +113,9 @@ struct translit_include_t
147e83
   struct translit_include_t *next;
147e83
 };
147e83
 
147e83
+/* Provide some dummy pointer for empty string.  */
147e83
+static uint32_t no_str[] = { 0 };
147e83
+
147e83
 
147e83
 /* Sparse table of uint32_t.  */
147e83
 #define TABLE idx_table
147e83
@@ -1873,7 +1876,7 @@ find_translit2 (struct locale_ctype_t *c
147e83
 
147e83
 	  for (wi = tirunp->from; wi <= wch; wi += tirunp->step)
147e83
 	    if (wi == wch)
147e83
-	      return (uint32_t []) { 0 };
147e83
+	      return no_str;
147e83
 	}
147e83
     }
147e83
 
147e83
@@ -1927,7 +1930,7 @@ read_widestring (struct linereader *ldfi
147e83
 
147e83
   if (now->tok == tok_default_missing)
147e83
     /* The special name "" will denote this case.  */
147e83
-    wstr = ((uint32_t *) { 0 });
147e83
+    wstr = no_str;
147e83
   else if (now->tok == tok_bsymbol)
147e83
     {
147e83
       /* Get the value from the repertoire.  */
147e83
@@ -4244,12 +4247,9 @@ allocate_arrays (struct locale_ctype_t *
147e83
     }
147e83
   else
147e83
     {
147e83
-      /* Provide some dummy pointers since we have nothing to write out.  */
147e83
-      static uint32_t no_str = { 0 };
147e83
-
147e83
-      ctype->translit_from_idx = &no_str;
147e83
-      ctype->translit_from_tbl = &no_str;
147e83
-      ctype->translit_to_tbl = &no_str;
147e83
+      ctype->translit_from_idx = no_str;
147e83
+      ctype->translit_from_tbl = no_str;
147e83
+      ctype->translit_to_tbl = no_str;
147e83
       ctype->translit_idx_size = 0;
147e83
       ctype->translit_from_tbl_size = 0;
147e83
       ctype->translit_to_tbl_size = 0;