streamclone: use readexactly when reading stream v2
Yuya Nishihara pointed out that it is safer.
--- a/mercurial/streamclone.py Wed Jan 24 21:37:48 2018 +0100
+++ b/mercurial/streamclone.py Wed Jan 24 21:44:31 2018 +0100
@@ -594,12 +594,12 @@
for vfs in vfsmap.values())
with nested(*ctxs):
for i in range(filecount):
- src = fp.read(1)
+ src = util.readexactly(fp, 1)
vfs = vfsmap[src]
namelen = util.uvarintdecodestream(fp)
datalen = util.uvarintdecodestream(fp)
- name = fp.read(namelen)
+ name = util.readexactly(fp, namelen)
if repo.ui.debugflag:
repo.ui.debug('adding [%s] %s (%s)\n' %