commit 70540bb5c2f5f14c96619bdbfb2bd2637e1db586 from: Omar Polo date: Wed Feb 02 09:47:28 2022 UTC fix format of Rstat `count' should be a 2-byte (16-bit) value and we're not neither accounting for it nor sending it. commit - 45fcf992e98c19d8aa61420fc475aac9ef50e157 commit + 70540bb5c2f5f14c96619bdbfb2bd2637e1db586 blob - c29b5422238ee627fed1bfecdfd94e454b6fa2cd blob + eb0702460e4c800a3c7daa1723e2b3c6916035de --- kamid/client.c +++ kamid/client.c @@ -141,7 +141,7 @@ static void np_open(uint16_t, struct qid *, uint32_t) static void np_create(uint16_t, struct qid *, uint32_t); static void np_read(uint16_t, uint32_t, void *); static void np_write(uint16_t, uint32_t); -static void np_stat(uint16_t, uint32_t, void *); +static void np_stat(uint16_t, uint16_t, void *); static void np_wstat(uint16_t); static void np_remove(uint16_t); static void np_error(uint16_t, const char *); @@ -732,14 +732,15 @@ np_write(uint16_t tag, uint32_t count) } static void -np_stat(uint16_t tag, uint32_t count, void *data) +np_stat(uint16_t tag, uint16_t count, void *data) { if (sizeof(count) + count + HEADERSIZE >= msize) { np_error(tag, "Rstat would overflow"); return; } - np_header(count, Rstat, tag); + np_header(sizeof(count) + count, Rstat, tag); + np_write16(evb, count); np_writebuf(evb, count, data); do_send(); }