diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-10-06 21:20:11 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-10-06 21:20:11 +0100 |
commit | d86c70af965c862651017ab4c288160f37ec654b (patch) | |
tree | 88f689e3f2c5a894820624ce103636acfcaf6c3a /client.c | |
parent | 4538c269d0b366a770a5a5ebfe0c5007569edbc1 (diff) | |
download | rtmux-d86c70af965c862651017ab4c288160f37ec654b.tar.gz rtmux-d86c70af965c862651017ab4c288160f37ec654b.tar.bz2 rtmux-d86c70af965c862651017ab4c288160f37ec654b.zip |
Don't look at string[length - 1] if length == 0.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -580,7 +580,7 @@ client_dispatch_wait(void *data0) imsg_free(&imsg); return (-1); case MSG_SHELL: - if (data[datalen - 1] != '\0') + if (datalen == 0 || data[datalen - 1] != '\0') fatalx("bad MSG_SHELL string"); clear_signals(0); @@ -664,7 +664,7 @@ client_dispatch_attached(void) kill(getpid(), SIGTSTP); break; case MSG_LOCK: - if (data[datalen - 1] != '\0') + if (datalen == 0 || data[datalen - 1] != '\0') fatalx("bad MSG_LOCK string"); system(data); |