diff options
author | Rob Landley <rob@landley.net> | 2015-07-06 19:41:57 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-07-06 19:41:57 -0500 |
commit | 3487bd353b4448bbdc9ece6d62fc4c4f4fd6ae4a (patch) | |
tree | 760cf34316c7672c2b7a6eeab5dff18669f7d29d | |
parent | cc585db6949917ef8d9d72d88e2fdbb8d6c63df0 (diff) | |
download | toybox-3487bd353b4448bbdc9ece6d62fc4c4f4fd6ae4a.tar.gz |
Avoid integer overflow with insane input data.
-rw-r--r-- | toys/posix/sort.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/sort.c b/toys/posix/sort.c index 49e68c74..ed7c36ce 100644 --- a/toys/posix/sort.c +++ b/toys/posix/sort.c @@ -384,7 +384,7 @@ void sort_main(void) // Output result for (idx = 0; idx<TT.linecount; idx++) { char *s = TT.lines[idx]; - int i = strlen(s); + unsigned i = strlen(s); if (!(toys.optflags&FLAG_z)) s[i] = '\n'; xwrite(fd, s, i+1); |