diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2013-10-15 11:45:32 +0100 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2013-10-15 11:45:32 +0100 |
commit | ca8159ba5542b903d34d8b98dbfd7789903d13f1 (patch) | |
tree | 68a5871910234e342b40c792efce1e3c12d1e89a | |
parent | 4b63d4aaaeb6ca64cf7dee6a0377060e01c3a8c6 (diff) | |
download | busybox-baserock/richardmaw/add-read-dash-d.tar.gz |
shells: Don't allow \0 in IFSbaserock/richardmaw/add-read-dash-d
-rw-r--r-- | shell/shell_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/shell_common.c b/shell/shell_common.c index 70be7f34d..f874fc75c 100644 --- a/shell/shell_common.c +++ b/shell/shell_common.c @@ -222,7 +222,7 @@ shell_builtin_read(void FAST_FUNC (*setvar)(const char *name, const char *val), if (argv[0]) { /* http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05 */ const char *is_ifs = strchr(ifs, c); - if (startword && is_ifs) { + if (startword && (c != '\0') && is_ifs) { if (isspace(c)) continue; /* it is a non-space ifs char */ |