From: Douglas Engert Date: Mon, 31 Jan 2005 04:20:12 +0000 (+0000) Subject: STABLE14-rx-packetreadwrite-adjust-offset-20050119 X-Git-Tag: openafs-devel-1_3_78~19 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=98ede708a97c452fd72aff6827cd5f6f5fb9a1ab;p=packages%2Fo%2Fopenafs.git STABLE14-rx-packetreadwrite-adjust-offset-20050119 offset - l must be zero in the second loop pass to avoid overwrites (cherry picked from commit 110b1f14bd5b5548211ece9a32c540490e0aef6a) --- diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index c5382a4a6..2c9059fd2 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -191,8 +191,10 @@ rx_SlowReadPacket(struct rx_packet * packet, unsigned int offset, int resid, j = MIN(resid, packet->wirevec[i].iov_len - (offset - l)); memcpy(out, (char *)(packet->wirevec[i].iov_base) + (offset - l), j); resid -= j; + offset = l; out += j; l += packet->wirevec[i].iov_len; + offset = l; i++; } @@ -234,6 +236,7 @@ rx_SlowWritePacket(struct rx_packet * packet, int offset, int resid, char *in) resid -= j; in += j; l += packet->wirevec[i].iov_len; + offset = l; i++; }