commit 1610d4872387cb3e06ec718fc70ddab17fa23bc8 from: Omar Polo date: Mon May 23 13:23:45 2022 UTC 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.) commit - 315eafe8807c0b6bf7a0a3d2ae072cbb6fa6392a commit + 1610d4872387cb3e06ec718fc70ddab17fa23bc8 blob - bcfcd2b4e70e22494a8c0c738d9768d0ff5ee00c blob + b9e9e26a6ba604b9615317316af4c55ae689459a --- 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);