summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorab196087 <none@none>2008-01-16 09:42:32 -0800
committerab196087 <none@none>2008-01-16 09:42:32 -0800
commitd321a33cdd896e6b211d113a33698dd76e89b861 (patch)
tree6b3465b76dea18e755d01ae4d2c1dcf415bc0f8d
parentb09b8ac7cd4799ad423c03bc4408dfadc2237f25 (diff)
downloadillumos-gate-d321a33cdd896e6b211d113a33698dd76e89b861.tar.gz
6508874 *error* dumps core on stdin fuzz testing
-rw-r--r--usr/src/cmd/sgs/error/common/errorsubr.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/usr/src/cmd/sgs/error/common/errorsubr.c b/usr/src/cmd/sgs/error/common/errorsubr.c
index 91a1dc5e02..ccba6592b8 100644
--- a/usr/src/cmd/sgs/error/common/errorsubr.c
+++ b/usr/src/cmd/sgs/error/common/errorsubr.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -21,7 +20,7 @@
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -93,7 +92,7 @@ strsave(char *instring)
{
char *outstring;
(void) strcpy(outstring = Calloc(1, strlen(instring) + 1),
- instring);
+ instring);
return (outstring);
}
/*
@@ -258,9 +257,9 @@ printerrors(boolean look_at_subclass, int errorc, Eptr errorv[])
if (look_at_subclass && errorp->error_s_class == C_DUPL)
continue;
(void) printf("Error %d, (%s error) [%s], text = \"",
- i,
- class_table[errorp->error_e_class],
- lang_table[errorp->error_language].lang_name);
+ i,
+ class_table[errorp->error_e_class],
+ lang_table[errorp->error_language].lang_name);
wordvprint(stdout, errorp->error_lgtext, errorp->error_text);
(void) printf("\"\n");
}
@@ -287,18 +286,16 @@ void
wordvbuild(char *string, int *r_wordc, char ***r_wordv)
{
char *cp;
- char *saltedbuffer;
- char **wordv;
- int wordcount;
- int wordindex;
+ char *saltedbuffer;
+ char **wordv;
+ int wordcount;
+ int wordindex;
saltedbuffer = strsave(string);
for (wordcount = 0, cp = saltedbuffer; *cp; wordcount++) {
while (*cp && isspace(*cp))
cp++;
- if (*cp == 0)
- break;
- while (!isspace(*cp))
+ while (*cp && !isspace(*cp))
cp++;
}
wordv = Calloc(wordcount + 1, sizeof (char *));
@@ -309,7 +306,7 @@ wordvbuild(char *string, int *r_wordc, char ***r_wordv)
if (*cp == 0)
break;
wordv[wordindex] = cp;
- while (!isspace(*cp))
+ while (*cp && !isspace(*cp))
cp++;
*cp++ = '\0';
}