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