summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2015-09-22 21:50:40 +0000
committermillert <millert@openbsd.org>2015-09-22 21:50:40 +0000
commit63ca93ea7fb9f6b99a9b84479a726160bfc45235 (patch)
tree06e50db98f71699b074afa02506e09c242501f51
parentUse explicit_bzero() to zero out the password. From Michael McConville. (diff)
downloadwireguard-openbsd-63ca93ea7fb9f6b99a9b84479a726160bfc45235.tar.xz
wireguard-openbsd-63ca93ea7fb9f6b99a9b84479a726160bfc45235.zip
Make errorf() and bi_errorf() handle a NULL argument.
From Michael McConville; OK nicm@
-rw-r--r--bin/ksh/c_ksh.c4
-rw-r--r--bin/ksh/exec.c4
-rw-r--r--bin/ksh/expr.c4
-rw-r--r--bin/ksh/io.c6
-rw-r--r--bin/ksh/lex.c4
-rw-r--r--bin/ksh/misc.c6
-rw-r--r--bin/ksh/var.c6
7 files changed, 17 insertions, 17 deletions
diff --git a/bin/ksh/c_ksh.c b/bin/ksh/c_ksh.c
index 491ac4c9af5..3f5fc13d4bd 100644
--- a/bin/ksh/c_ksh.c
+++ b/bin/ksh/c_ksh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: c_ksh.c,v 1.41 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: c_ksh.c,v 1.42 2015/09/22 21:50:40 millert Exp $ */
/*
* built-in Korn commands: c_*
@@ -1160,7 +1160,7 @@ c_kill(char **wp)
shf_fprintf(shl_out,
"usage: kill [-s signame | -signum | -signame] { job | pid | pgrp } ...\n"
" kill -l [exit_status ...]\n");
- bi_errorf(null);
+ bi_errorf(NULL);
return 1;
}
diff --git a/bin/ksh/exec.c b/bin/ksh/exec.c
index d8d1ef23c66..809013b8813 100644
--- a/bin/ksh/exec.c
+++ b/bin/ksh/exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.c,v 1.56 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: exec.c,v 1.57 2015/09/22 21:50:40 millert Exp $ */
/*
* execute command tree
@@ -107,7 +107,7 @@ execute(struct op *volatile t,
*/
if (tp && tp->type == CSHELL &&
(tp->flag & SPEC_BI))
- errorf(null);
+ errorf(NULL);
/* Deal with FERREXIT, quitenv(), etc. */
goto Break;
}
diff --git a/bin/ksh/expr.c b/bin/ksh/expr.c
index 6d53c7882c9..effc20d42ce 100644
--- a/bin/ksh/expr.c
+++ b/bin/ksh/expr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expr.c,v 1.27 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: expr.c,v 1.28 2015/09/22 21:50:40 millert Exp $ */
/*
* Korn expression evaluation
@@ -187,7 +187,7 @@ v_evaluate(struct tbl *vp, const char *expr, volatile int error_ok,
if (i == LAEXPR) {
if (error_ok == KSH_RETURN_ERROR)
return 0;
- errorf(null);
+ errorf(NULL);
}
unwind(i);
/* NOTREACHED */
diff --git a/bin/ksh/io.c b/bin/ksh/io.c
index 613e5dc576a..736b0857826 100644
--- a/bin/ksh/io.c
+++ b/bin/ksh/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.29 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: io.c,v 1.30 2015/09/22 21:50:40 millert Exp $ */
/*
* shell buffered IO and formatted output
@@ -23,7 +23,7 @@ errorf(const char *fmt, ...)
shl_stdout_ok = 0; /* debugging: note that stdout not valid */
exstat = 1;
- if (*fmt) {
+ if (fmt != NULL && *fmt != '\0') {
error_prefix(true);
va_start(va, fmt);
shf_vfprintf(shl_out, fmt, va);
@@ -58,7 +58,7 @@ bi_errorf(const char *fmt, ...)
shl_stdout_ok = 0; /* debugging: note that stdout not valid */
exstat = 1;
- if (*fmt) {
+ if (fmt != NULL && *fmt != '\0') {
error_prefix(true);
/* not set when main() calls parse_args() */
if (builtin_argv0)
diff --git a/bin/ksh/lex.c b/bin/ksh/lex.c
index 262b318c683..8bdf471f553 100644
--- a/bin/ksh/lex.c
+++ b/bin/ksh/lex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.c,v 1.54 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: lex.c,v 1.55 2015/09/22 21:50:40 millert Exp $ */
/*
* lexical analysis and source input
@@ -909,7 +909,7 @@ yyerror(const char *fmt, ...)
va_start(va, fmt);
shf_vfprintf(shl_out, fmt, va);
va_end(va);
- errorf(null);
+ errorf(NULL);
}
/*
diff --git a/bin/ksh/misc.c b/bin/ksh/misc.c
index efacd94ac1b..5e8472771be 100644
--- a/bin/ksh/misc.c
+++ b/bin/ksh/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.45 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: misc.c,v 1.46 2015/09/22 21:50:40 millert Exp $ */
/*
* Miscellaneous functions
@@ -902,7 +902,7 @@ ksh_getopt(char **argv, Getopt *go, const char *options)
(go->flags & GF_NONAME) ? "" : argv[0],
(go->flags & GF_NONAME) ? "" : ": ", c);
if (go->flags & GF_ERROR)
- bi_errorf(null);
+ bi_errorf(NULL);
}
return '?';
}
@@ -928,7 +928,7 @@ ksh_getopt(char **argv, Getopt *go, const char *options)
(go->flags & GF_NONAME) ? "" : argv[0],
(go->flags & GF_NONAME) ? "" : ": ", c);
if (go->flags & GF_ERROR)
- bi_errorf(null);
+ bi_errorf(NULL);
return '?';
}
go->p = 0;
diff --git a/bin/ksh/var.c b/bin/ksh/var.c
index a35c9d96873..f0ee491444d 100644
--- a/bin/ksh/var.c
+++ b/bin/ksh/var.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: var.c,v 1.49 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: var.c,v 1.50 2015/09/22 21:50:40 millert Exp $ */
#include "sh.h"
#include <time.h>
@@ -354,7 +354,7 @@ setstr(struct tbl *vq, const char *s, int error_ok)
if ((vq->flag & RDONLY) && !no_ro_check) {
warningf(true, "%s: is read only", vq->name);
if (!error_ok)
- errorf(null);
+ errorf(NULL);
return 0;
}
if (!(vq->flag&INTEGER)) { /* string dest */
@@ -704,7 +704,7 @@ typeset(const char *var, int set, int clr, int field, int base)
}
}
if (!ok)
- errorf(null);
+ errorf(NULL);
}
if (val != NULL) {