]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-rx-packetreadwrite-adjust-offset-20050119
authorDouglas Engert <deengert@anl.gov>
Mon, 31 Jan 2005 04:20:12 +0000 (04:20 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 31 Jan 2005 04:20:12 +0000 (04:20 +0000)
offset - l must be zero in the second loop pass to avoid overwrites

(cherry picked from commit 110b1f14bd5b5548211ece9a32c540490e0aef6a)

src/rx/rx_packet.c

index c5382a4a675eb6c74e491818577b9d15a62b5cda..2c9059fd2b53da2a2116be3b6a1a5448afed21a3 100644 (file)
@@ -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++;
     }