hush: fix read builtin to not read ahead past eol and to not use

insane amounts of stack. Testsuite updated.
This commit is contained in:
Denis Vlasenko 2007-06-13 06:47:47 +00:00
parent f5f75c5e82
commit d67cef2425
10 changed files with 68 additions and 31 deletions

View file

@ -99,7 +99,7 @@ int readprofile_main(int argc, char **argv)
/*
* Use an fd for the profiling buffer, to skip stdio overhead
*/
len = INT_MAX;
len = MAXINT(ssize_t);
buf = xmalloc_open_read_close(proFile, &len);
if (!optNative) {
int entries = len/sizeof(*buf);