summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2021-09-01 01:08:06 -0400
committerdusoleil <howcansocksbereal@gmail.com>2021-09-01 01:08:06 -0400
commite409f0953fcdc1e570871a7e37548fcd9340bb70 (patch)
tree96c7aaec8f5b1681c2c9151c2b081827ad5f28cb
parent4f2f653df637ee509eebfdf8a2ff4cb0f1898a43 (diff)
downloadsploit-e409f0953fcdc1e570871a7e37548fcd9340bb70.tar.gz
sploit-e409f0953fcdc1e570871a7e37548fcd9340bb70.zip
Correct read() Semantics
The BufferedReader's .read() doesn't behave as expected. It reads EXACTLY size bytes and will block until there are enough available to read. os.read() does what we expect. It will read UP TO size bytes and only block if there is nothing available to read. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
-rw-r--r--sploit/comm.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sploit/comm.py b/sploit/comm.py
index fc220ef..9a20318 100644
--- a/sploit/comm.py
+++ b/sploit/comm.py
@@ -13,7 +13,7 @@ class Comm:
self.back = backend
def read(self, size):
- data = self.back.stdin.read(size)
+ data = os.read(self.back.stdin.fileno(), size)
if(data == b''):
raise BrokenPipeError('Tried to read on broken pipe')
log(data)