summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2016-03-17 19:40:43 +0000
committerkrw <krw@openbsd.org>2016-03-17 19:40:43 +0000
commit534084640310a3b73784adb5e68a3695b1c4a21c (patch)
tree6f4f33f996feb61f08988b759dea9f9a06a42f9a
parentSet mnt_data to NULL after freeing the file system specific mount point. (diff)
downloadwireguard-openbsd-534084640310a3b73784adb5e68a3695b1c4a21c.tar.xz
wireguard-openbsd-534084640310a3b73784adb5e68a3695b1c4a21c.zip
Last parameter to execl[e]() functions *must* be cast to a pointer.
Just NULL is not good practise as NULL is theoretically allowed to be an integer rather than a pointer. Use (char *)NULL consistently instead of scattering a few (char *)0 and (void *)NULL into the mix. Prompted by and probably ok deraadt@ millert@ kettenis@ Definitely ok mestre@ ratchov@
-rw-r--r--regress/lib/libpthread/signals/ignore_sigchild/ignore_sigchild.c4
-rw-r--r--regress/sys/kern/exec_self/exec_self.c4
-rw-r--r--regress/sys/kern/kqueue/kqueue-process.c4
-rw-r--r--sbin/swapctl/swapctl.c4
-rw-r--r--usr.bin/ftp/cmds.c6
-rw-r--r--usr.bin/sendbug/sendbug.c4
-rw-r--r--usr.bin/usbhidaction/usbhidaction.c4
-rw-r--r--usr.sbin/pppd/main.c4
-rw-r--r--usr.sbin/smtpd/makemap.c4
-rw-r--r--usr.sbin/smtpd/smtpctl.c8
-rw-r--r--usr.sbin/smtpd/smtpd.c4
-rw-r--r--usr.sbin/vmctl/main.c4
12 files changed, 27 insertions, 27 deletions
diff --git a/regress/lib/libpthread/signals/ignore_sigchild/ignore_sigchild.c b/regress/lib/libpthread/signals/ignore_sigchild/ignore_sigchild.c
index c08f38ccc38..8c20455ae54 100644
--- a/regress/lib/libpthread/signals/ignore_sigchild/ignore_sigchild.c
+++ b/regress/lib/libpthread/signals/ignore_sigchild/ignore_sigchild.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ignore_sigchild.c,v 1.2 2011/10/10 08:21:06 fgsch Exp $ */
+/* $OpenBSD: ignore_sigchild.c,v 1.3 2016/03/17 19:40:43 krw Exp $ */
/*
* Federico G. Schwindt <fgsch@openbsd.org>, 2011. Public Domain.
*/
@@ -20,7 +20,7 @@ main(int argc, char **argv)
case -1:
PANIC("fork");
case 0:
- execl("/usr/bin/false", "false", NULL);
+ execl("/usr/bin/false", "false", (char *)NULL);
PANIC("execlp");
default:
break;
diff --git a/regress/sys/kern/exec_self/exec_self.c b/regress/sys/kern/exec_self/exec_self.c
index 4bf39af5f7c..7d3e67a441a 100644
--- a/regress/sys/kern/exec_self/exec_self.c
+++ b/regress/sys/kern/exec_self/exec_self.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_self.c,v 1.1 2002/08/17 22:58:59 art Exp $ */
+/* $OpenBSD: exec_self.c,v 1.2 2016/03/17 19:40:43 krw Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -36,7 +36,7 @@ main(int argc, char **argv)
MADV_FREE))
err(1, "madvise");
- if (execl(argv[0], argv[0], &blob.string, NULL))
+ if (execl(argv[0], argv[0], &blob.string, (char *)NULL))
err(1, "execl");
/* NOTREACHED */
diff --git a/regress/sys/kern/kqueue/kqueue-process.c b/regress/sys/kern/kqueue/kqueue-process.c
index d4dfa8d02e9..d62b2699d18 100644
--- a/regress/sys/kern/kqueue/kqueue-process.c
+++ b/regress/sys/kern/kqueue/kqueue-process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kqueue-process.c,v 1.8 2015/08/13 10:26:54 uebayasi Exp $ */
+/* $OpenBSD: kqueue-process.c,v 1.9 2016/03/17 19:40:43 krw Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain
*/
@@ -151,7 +151,7 @@ process_child(void)
case 0:
/* sync 2.1 */
pause();
- execl("/usr/bin/true", "true", (void *)NULL);
+ execl("/usr/bin/true", "true", (char *)NULL);
err(1, "execl(true)");
}
diff --git a/sbin/swapctl/swapctl.c b/sbin/swapctl/swapctl.c
index 6b4cf96746a..2511419e961 100644
--- a/sbin/swapctl/swapctl.c
+++ b/sbin/swapctl/swapctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: swapctl.c,v 1.22 2015/09/15 17:46:23 schwarze Exp $ */
+/* $OpenBSD: swapctl.c,v 1.23 2016/03/17 19:40:43 krw Exp $ */
/* $NetBSD: swapctl.c,v 1.9 1998/07/26 20:23:15 mycroft Exp $ */
/*
@@ -399,7 +399,7 @@ do_fstab(void)
err(1, "vfork");
case 0:
execl(PATH_MOUNT, PATH_MOUNT, fp->fs_spec, spec,
- NULL);
+ (char *)NULL);
err(1, "execl");
}
while (waitpid(pid, &status, 0) < 0)
diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c
index ede6398868c..2b3bc72b79c 100644
--- a/usr.bin/ftp/cmds.c
+++ b/usr.bin/ftp/cmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmds.c,v 1.75 2015/10/18 03:04:11 mmcc Exp $ */
+/* $OpenBSD: cmds.c,v 1.76 2016/03/17 19:40:43 krw Exp $ */
/* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */
/*
@@ -1007,10 +1007,10 @@ shell(int argc, char *argv[])
(void)fflush(ttyout);
}
if (argc > 1) {
- execl(shellp, shellnam, "-c", altarg, (char *)0);
+ execl(shellp, shellnam, "-c", altarg, (char *)NULL);
}
else {
- execl(shellp, shellnam, (char *)0);
+ execl(shellp, shellnam, (char *)NULL);
}
warn("%s", shellp);
code = -1;
diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c
index dc39073328e..bba83035ae1 100644
--- a/usr.bin/sendbug/sendbug.c
+++ b/usr.bin/sendbug/sendbug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sendbug.c,v 1.73 2015/10/26 13:12:10 deraadt Exp $ */
+/* $OpenBSD: sendbug.c,v 1.74 2016/03/17 19:40:43 krw Exp $ */
/*
* Written by Ray Lai <ray@cyth.net>.
@@ -337,7 +337,7 @@ sendmail(const char *pathname)
}
close(filedes[0]);
execl(_PATH_SENDMAIL, "sendmail",
- "-oi", "-t", (void *)NULL);
+ "-oi", "-t", (char *)NULL);
warn("sendmail error: unsent report in %s",
pathname);
return (-1);
diff --git a/usr.bin/usbhidaction/usbhidaction.c b/usr.bin/usbhidaction/usbhidaction.c
index 704d4e45dac..e71e70cc73d 100644
--- a/usr.bin/usbhidaction/usbhidaction.c
+++ b/usr.bin/usbhidaction/usbhidaction.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbhidaction.c,v 1.21 2015/10/26 10:08:14 jung Exp $ */
+/* $OpenBSD: usbhidaction.c,v 1.22 2016/03/17 19:40:43 krw Exp $ */
/* $NetBSD: usbhidaction.c,v 1.7 2002/01/18 14:38:59 augustss Exp $ */
/*
@@ -441,7 +441,7 @@ docmd(struct command *cmd, int value, const char *hid, int argc, char **argv)
setpgid(0, 0);
if (verbose)
printf("executing '%s'\n", cmdbuf);
- r = execl(_PATH_BSHELL, "sh", "-c", cmdbuf, NULL);
+ r = execl(_PATH_BSHELL, "sh", "-c", cmdbuf, (char *)NULL);
err(1, "execl");
}
}
diff --git a/usr.sbin/pppd/main.c b/usr.sbin/pppd/main.c
index 9b2179e2ed2..99d4e932b11 100644
--- a/usr.sbin/pppd/main.c
+++ b/usr.sbin/pppd/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.53 2015/12/06 12:00:16 tobias Exp $ */
+/* $OpenBSD: main.c,v 1.54 2016/03/17 19:40:43 krw Exp $ */
/*
* main.c - Point-to-Point Protocol main module
@@ -1101,7 +1101,7 @@ device_script(program, in, out)
_exit(1);
}
- execl("/bin/sh", "sh", "-c", program, (char *)0);
+ execl("/bin/sh", "sh", "-c", program, (char *)NULL);
syslog(LOG_ERR, "could not exec /bin/sh: %m");
_exit(99);
/* NOTREACHED */
diff --git a/usr.sbin/smtpd/makemap.c b/usr.sbin/smtpd/makemap.c
index 7986387079a..408b2f70d96 100644
--- a/usr.sbin/smtpd/makemap.c
+++ b/usr.sbin/smtpd/makemap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: makemap.c,v 1.64 2016/02/13 08:53:18 gilles Exp $ */
+/* $OpenBSD: makemap.c,v 1.65 2016/03/17 19:40:43 krw Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -170,7 +170,7 @@ makemap(int argc, char *argv[])
}
execlp("makemap", "makemap", "-d", argv[0], "-o", dbname, "-",
- NULL);
+ (char *)NULL);
err(1, "execlp");
}
diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c
index cb377c52691..adc1cae1c0f 100644
--- a/usr.sbin/smtpd/smtpctl.c
+++ b/usr.sbin/smtpd/smtpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpctl.c,v 1.147 2016/02/12 03:11:16 sunil Exp $ */
+/* $OpenBSD: smtpctl.c,v 1.148 2016/03/17 19:40:43 krw Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -868,7 +868,7 @@ do_encrypt(int argc, struct parameter *argv)
if (argv)
p = argv[0].u.u_str;
- execl(PATH_ENCRYPT, "encrypt", p, NULL);
+ execl(PATH_ENCRYPT, "encrypt", p, (char *)NULL);
errx(1, "execl");
}
@@ -1259,9 +1259,9 @@ display(const char *s)
lseek(fileno(fp), 0, SEEK_SET);
(void)dup2(fileno(fp), STDIN_FILENO);
if (gzipped)
- execl(PATH_GZCAT, gzcat_argv0, NULL);
+ execl(PATH_GZCAT, gzcat_argv0, (char *)NULL);
else
- execl(PATH_CAT, "cat", NULL);
+ execl(PATH_CAT, "cat", (char *)NULL);
err(1, "execl");
}
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c
index 23c08aa8875..7af2d21b99e 100644
--- a/usr.sbin/smtpd/smtpd.c
+++ b/usr.sbin/smtpd/smtpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.c,v 1.274 2016/02/05 19:15:15 jung Exp $ */
+/* $OpenBSD: smtpd.c,v 1.275 2016/03/17 19:40:43 krw Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -836,7 +836,7 @@ fork_proc_backend(const char *key, const char *conf, const char *procname)
if (procname == NULL)
procname = name;
- execl(path, procname, arg, NULL);
+ execl(path, procname, arg, (char *)NULL);
err(1, "execl: %s", path);
}
diff --git a/usr.sbin/vmctl/main.c b/usr.sbin/vmctl/main.c
index eed09034198..c12c74a2c41 100644
--- a/usr.sbin/vmctl/main.c
+++ b/usr.sbin/vmctl/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.14 2016/01/26 07:55:47 reyk Exp $ */
+/* $OpenBSD: main.c,v 1.15 2016/03/17 19:40:43 krw Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -541,6 +541,6 @@ __dead void
ctl_openconsole(const char *name)
{
closefrom(STDERR_FILENO + 1);
- execl(VMCTL_CU, VMCTL_CU, "-l", name, "-s", "9600", NULL);
+ execl(VMCTL_CU, VMCTL_CU, "-l", name, "-s", "9600", (char *)NULL);
err(1, "failed to open the console");
}