diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-01-18 08:41:22 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-01-18 08:41:22 +0000 |
commit | 1a250d9f32361b30a8a632ecc0023680b1e38323 (patch) | |
tree | 634f2b8f7993201c71c790ff05a1c78499557cf3 /coreutils | |
parent | 7f0d7ae4f55a810d57ef07d5cd964435dd87e6dc (diff) | |
download | busybox-1a250d9f32361b30a8a632ecc0023680b1e38323.tar.gz |
- reinstate paranoia check in wrapf().
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/stty.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c index 3ce8bf312..4e665bcb7 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -462,8 +462,9 @@ static void wrapf(const char *message, ...) va_start(args, message); buflen = vsnprintf(buf, sizeof(buf), message, args); va_end(args); - /* buflen = strlen(buf); cheaper not to pull in strlen */ - if (!buflen /*|| buflen >= sizeof(buf)*/) return; + /* We seem to be called only with suitable lengths, but check if + somebody failed to adhere to this assumption just to be sure. */ + if (!buflen || buflen >= sizeof(buf)) return; if (current_col > 0) { current_col++; |