arrfab / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1349982.patch

147e83
commit 0ce3b29d56632acd1c393714cc8f189496bdeb47
147e83
Author: Carlos O'Donell <carlos@systemhalted.org>
147e83
Date:   Fri Jun 24 13:50:22 2016 -0400
147e83
147e83
    Resolves: #1349906
147e83
147e83
    - Properly handle more invalid --install-langs arguments (#1349906).
147e83
147e83
diff -Nrup a/releng/build-locale-archive.c b/releng/build-locale-archive.c
147e83
--- a/releng/build-locale-archive.c	2018-05-03 11:31:08.474376209 -0400
147e83
+++ b/releng/build-locale-archive.c	2018-05-03 11:35:21.001309474 -0400
147e83
@@ -640,7 +640,7 @@ int main (int argc, char *argv[])
147e83
   char *lang;
147e83
   int install_langs_count = 0;
147e83
   char *install_langs_arg, *ila_start;
147e83
-  char **install_langs_list;
147e83
+  char **install_langs_list = NULL;
147e83
   unsigned int cnt = 0;
147e83
   struct locarhandle tmpl_ah = {};
147e83
 
147e83
@@ -713,6 +713,11 @@ int main (int argc, char *argv[])
147e83
                   install_langs_arg = NULL;
147e83
                 }
147e83
 	      free (ila_start);
147e83
+
147e83
+              /* Reject an entire string made up of delimiters.  */
147e83
+              if (install_langs_count == 0)
147e83
+                break;
147e83
+
147e83
 	      /* Copy the list.  */
147e83
 	      install_langs_list = (char **)xmalloc (sizeof(char *) * install_langs_count);
147e83
 	      install_langs_arg = ila_start = strdup (optarg);