Discussion:
[9fans] IOHDRSZ
(too old to reply)
erik quanstrom
2013-04-04 19:50:54 UTC
Permalink
i wonder if the typical use of IOHDRSZ is correct.

many programs set
msize = bufsize + IOHDRSIZE
but Twrite has 2+4+8+4=18 bytes overhead, so
i think this assumption is going to lead to
6-byte buffer overruns.

- erik
Charles Forsyth
2013-04-04 20:14:08 UTC
Permalink
Post by erik quanstrom
so
i think this assumption is going to lead to
6-byte buffer overruns.
I don't follow the reasoning. bufsize + Rread or Twrite will always fit.
bufsize is the limit for application data. The receiving 9P also trims the
count
to match the receiving buffer.
erik quanstrom
2013-04-04 20:49:08 UTC
Permalink
Post by Charles Forsyth
Post by erik quanstrom
so
i think this assumption is going to lead to
6-byte buffer overruns.
I don't follow the reasoning. bufsize + Rread or Twrite will always fit.
bufsize is the limit for application data. The receiving 9P also trims the
count
to match the receiving buffer.
i'm thinking of applications that have a seperate buffer for data.
in this case, i can't think of a clean way of sizing that seperate buffer
correctly. if msize=bufsize+IOHDRSZ, then incoming bytes would
be too big.

- erik

Loading...