Commit Diff
- Commit:
1610d4872387cb3e06ec718fc70ddab17fa23bc8
- From:
- Omar Polo <op@omarpolo.com>
- Date:
- Message:
- cmd_ls: fix read size don't use a constant: msize may be lower than that. Instead, use `msize - 4' which is guaranteed to be the maximum transferreable size. (it's not possible for msize to be lower than 4 since we reject ridiculously small msizes, so that difference can't underflow.)
- Actions:
- Patch | Tree
--- kamiftp/ftp.c +++ kamiftp/ftp.c @@ -1288,7 +1288,7 @@ cmd_ls(int argc, const char **argv) evbuffer_drain(dirbuf, EVBUFFER_LENGTH(dirbuf)); for (;;) { - tread(nfid, off, BUFSIZ); + tread(nfid, off, msize - 4); do_send(); recv_msg(); expect2(Rread, iota_tag);