diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-04-15 13:04:20 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-04-15 13:04:53 +0100 |
commit | c2c9b77f141f3462414789b696dcee2cc2789bc4 (patch) | |
tree | 40b04cc5db4fc36719db4a74fcffc206da1f78e4 | |
parent | 533c5ee7ad8c6d6e4eb2d05d8fc61c1e11a2705e (diff) | |
download | rtmux-c2c9b77f141f3462414789b696dcee2cc2789bc4.tar.gz rtmux-c2c9b77f141f3462414789b696dcee2cc2789bc4.tar.bz2 rtmux-c2c9b77f141f3462414789b696dcee2cc2789bc4.zip |
Do not use the command if the kernel didn't return the full size.
-rw-r--r-- | osdep-darwin.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/osdep-darwin.c b/osdep-darwin.c index d4a88028..6b2b1d72 100644 --- a/osdep-darwin.c +++ b/osdep-darwin.c @@ -61,7 +61,7 @@ osdep_get_name(int fd, __unused char *tty) size = sizeof kp; if (sysctl(mib, 4, &kp, &size, NULL, 0) == -1) return (NULL); - if (*kp.kp_proc.p_comm == '\0') + if (size != (sizeof kp) || *kp.kp_proc.p_comm == '\0') return (NULL); return (strdup(kp.kp_proc.p_comm)); |