diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2021-09-01 01:08:06 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2021-09-01 01:08:06 -0400 |
commit | c394b31ecbcc78682629ef20b552de32e2ac3e9e (patch) | |
tree | 00517200c526e7baa1f7c2825fcdf0a3f37fc7e2 /tools/sploit | |
parent | a5d0003aa8f3f14076945a9a01ea23915be874dc (diff) | |
download | lib-des-gnux-c394b31ecbcc78682629ef20b552de32e2ac3e9e.tar.gz lib-des-gnux-c394b31ecbcc78682629ef20b552de32e2ac3e9e.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>
Diffstat (limited to 'tools/sploit')
-rw-r--r-- | tools/sploit/sploit/comm.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/sploit/sploit/comm.py b/tools/sploit/sploit/comm.py index fc220ef..9a20318 100644 --- a/tools/sploit/sploit/comm.py +++ b/tools/sploit/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) |