changeset 1282:c1a507ba398b

Merge with BOS
author mpm@selenic.com
date Tue, 20 Sep 2005 11:38:01 -0700
parents 50553b99a5c9 (diff) 84df9951532a (current diff)
children f5faab34f32e
files
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Sep 20 11:20:48 2005 -0700
+++ b/mercurial/localrepo.py	Tue Sep 20 11:38:01 2005 -0700
@@ -956,7 +956,12 @@
             if not d: return ""
             l = struct.unpack(">l", d)[0]
             if l <= 4: return ""
-            return source.read(l - 4)
+            d = source.read(l - 4)
+            if len(d) < l - 4:
+                raise repo.RepoError("premature EOF reading chunk" +
+                                     " (got %d bytes, expected %d)"
+                                     % (len(d), l - 4))
+            return d
 
         def getgroup():
             while 1: