]> git.michaelhowe.org Git - packages/b/bup.git/commitdiff
DemuxConn.__init__: abort the loop if read() returns EOF.
authorAvery Pennarun <apenwarr@gmail.com>
Thu, 3 Feb 2011 23:07:48 +0000 (15:07 -0800)
committerAvery Pennarun <apenwarr@gmail.com>
Thu, 3 Feb 2011 23:07:48 +0000 (15:07 -0800)
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
lib/bup/helpers.py

index 41c5229128fb7f5fae3735f21763ae0b7a8235ba..20339a628852293564d124394aa6118bebd583f7 100644 (file)
@@ -328,7 +328,10 @@ class DemuxConn(BaseConn):
         # multiplexed and can be assumed to be debug/log before mux init.
         tail = ''
         while tail != 'BUPMUX':
-            tail += os.read(infd, 1024)
+            b = os.read(infd, 1024)
+            if not b:
+                raise IOError('demux: unexpected EOF during initialization')
+            tail += b
             buf = tail[:-6]
             tail = tail[-6:]
             sys.stderr.write(buf)