citronneur / rdpy

Remote Desktop Protocol in Twisted Python
GNU General Public License v3.0
1.67k stars 545 forks source link

Stream is too small to read expected SimpleType in rdp-rssplayer.py #58

Open rweijnen opened 7 years ago

rweijnen commented 7 years ago

[] ERROR: Error during read <class 'rdpy.core.rss.UpdateEvent'>::length [] ERROR: Error during read <class 'rdpy.core.rss.Event'>::event Traceback (most recent call last): File "/root/Documents/rdpy/rdpy/bin/rdpy-rssplayer.py", line 104, in QtCore.QTimer.singleShot(e.timestamp.value,lambda:loop(widget, rssFile, e)) File "/root/Documents/rdpy/rdpy/bin/rdpy-rssplayer.py", line 103, in loop e = rssFile.nextEvent() File "build/bdist.linux-x86_64/egg/rdpy/core/rss.py", line 282, in nextEvent File "build/bdist.linux-x86_64/egg/rdpy/core/type.py", line 898, in readType File "build/bdist.linux-x86_64/egg/rdpy/core/type.py", line 97, in read File "build/bdist.linux-x86_64/egg/rdpy/core/type.py", line 478, in read rdpy.core.error.InvalidSize: Stream is too small to read expected SimpleType

Hitting an exception in type.py on line 478

def __read__(self, s):
    """
    @summary:  Read inner value from stream
                Use struct package to unpack
                In accordance of structFormat and typeSize fields
    @param s: Stream that will be read
    @raise InvalidSize: if there is not enough data in stream
    """
    if s.dataLen() < self._typeSize:
        raise InvalidSize("Stream is too small to read expected SimpleType ")           

    self.value = struct.unpack(self._structFormat, s.read(self._typeSize))[0]

dataLen is 1 but typeSize is 4