aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2001-03-02 02:56:52 +0000
committerFritz Elfert <felfert@to.com>2001-03-02 02:56:52 +0000
commit46045e41ea97a354a415145383ce6b712ea4372c (patch)
tree07aeb7912e250c69b9d8e1639488e4d2a15bbbf4 /lib
parentbb93b6dffcf8bda150dd0b0b3b38e444d3faec1d (diff)
downloadplptools-46045e41ea97a354a415145383ce6b712ea4372c.tar.gz
plptools-46045e41ea97a354a415145383ce6b712ea4372c.tar.bz2
plptools-46045e41ea97a354a415145383ce6b712ea4372c.zip
Fixed a nasty bug in fread() which reads garbage when called with a length
parameter > RFSV_SENDLEN. Exploited by plpnfsd which is currently the only app doing large reads. Thanks to rrt1001@cam.ac.uk for his bug-report.
Diffstat (limited to 'lib')
-rw-r--r--lib/rfsv32.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rfsv32.cc b/lib/rfsv32.cc
index 2dc5fbb..7849d97 100644
--- a/lib/rfsv32.cc
+++ b/lib/rfsv32.cc
@@ -441,7 +441,7 @@ fread(const u_int32_t handle, unsigned char * const buf, const u_int32_t len, u_
if ((l = a.getLen()) > 0) {
memcpy(p, a.getString(), l);
count += l;
- p += res;
+ p += l;
}
} while ((count < len) && (l > 0));
return res;