mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 19:39:04 +00:00
Do not use the command if the kernel didn't return the full size.
This commit is contained in:
parent
533c5ee7ad
commit
c2c9b77f14
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user