Print this page
10088 ldterm_do_ioctl() shouldn't check for a NULL array

@@ -19,11 +19,11 @@
  * CDDL HEADER END
  */
 /*
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
- * Copyright (c) 2014, Joyent, Inc.  All rights reserved.
+ * Copyright (c) 2018, Joyent, Inc.
  * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
  */
 
 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T      */
 /* All Rights Reserved                                  */

@@ -4597,11 +4597,11 @@
                         maxbytelen = 4;
                         maxscreenlen = 2;
                 }
 
                 locale_name_sz = 0;
-                if (csdp->locale_name) {
+
                         for (i = 0; i < MAXNAMELEN; i++)
                                 if (csdp->locale_name[i] == '\0')
                                         break;
                         /*
                          * We cannot have any string that is not NULL byte

@@ -4611,11 +4611,10 @@
                                 miocnak(q, mp, 0, ERANGE);
                                 return;
                         }
 
                         locale_name_sz = i + 1;
-                }
 
                 /*
                  * As the final check, if there was invalid codeset_type
                  * given, or invalid byte_length was specified, it's an error.
                  */