arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone
Blob Blame History Raw
commit 0ce3b29d56632acd1c393714cc8f189496bdeb47
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Fri Jun 24 13:50:22 2016 -0400

    Resolves: #1349906

    - Properly handle more invalid --install-langs arguments (#1349906).

diff -Nrup a/releng/build-locale-archive.c b/releng/build-locale-archive.c
--- a/releng/build-locale-archive.c	2018-05-03 11:31:08.474376209 -0400
+++ b/releng/build-locale-archive.c	2018-05-03 11:35:21.001309474 -0400
@@ -640,7 +640,7 @@ int main (int argc, char *argv[])
   char *lang;
   int install_langs_count = 0;
   char *install_langs_arg, *ila_start;
-  char **install_langs_list;
+  char **install_langs_list = NULL;
   unsigned int cnt = 0;
   struct locarhandle tmpl_ah = {};
 
@@ -713,6 +713,11 @@ int main (int argc, char *argv[])
                   install_langs_arg = NULL;
                 }
 	      free (ila_start);
+
+              /* Reject an entire string made up of delimiters.  */
+              if (install_langs_count == 0)
+                break;
+
 	      /* Copy the list.  */
 	      install_langs_list = (char **)xmalloc (sizeof(char *) * install_langs_count);
 	      install_langs_arg = ila_start = strdup (optarg);