commit 93c0742a02792f3505d66c840b0d752e04e2523a from: Omar Polo date: Mon Dec 27 15:47:33 2021 UTC simple fix to avoid messages bigger than what we can currently handle commit - 2ef8253c54b819cd5dfddc3fad3d120c97f96cc4 commit + 93c0742a02792f3505d66c840b0d752e04e2523a blob - bdfbe590945591ce89b564967e7ebb86cd2a110e blob + 211872b9600efbe19e1513a667b3686e484eb1f8 --- client.c +++ client.c @@ -35,6 +35,15 @@ #include "sandbox.h" #include "utils.h" +/* + * XXX: atm is difficult to accept messages bigger than MAX_IMSGSIZE + * minus IMSG_HEADER_SIZE, we need something to split messages into + * chunks and receive them one by the other. + * + * CLIENT_MSIZE is thus the maximum message size we can handle now. + */ +#define CLIENT_MSIZE (MAX_IMSGSIZE - IMSG_HEADER_SIZE) + #define DEBUG_PACKETS 0 /* straight outta /src/usr.bin/ssh/scp.c */ @@ -861,7 +870,7 @@ tversion(struct np_msg_header *hdr, const uint8_t *dat /* version matched */ handshaked = 1; - msize = MIN(msize, MSIZE9P); + msize = MIN(msize, CLIENT_MSIZE); client_send_listener(IMSG_MSIZE, &msize, sizeof(msize)); np_version(hdr->tag, msize, VERSION9P); return;