randr getscreeninfo malformed reply
Submitted by sny..@..yh.org
Assigned to Keith Packard @keithp
Description
Created attachment 91355 the wireshark captured packet when run above python code
import xcb
from xcb import randr
con = xcb.connect()
ran = con(randr.key)
ver = ran.QueryVersion(1, 3).reply()
root = con.get_setup().roots[0].root
ran.GetScreenInfo(root).reply()
this will panic:
Traceback (most recent call last):
File "a.py", line 11, in `<module>`
ran.GetScreenInfo(root).reply()
File "/usr/lib/python2.7/dist-packages/xcb/randr.py", line 101, in __init__
self.rates = xcb.List(parent, offset, (self.nInfo - self.nSizes), RefreshRates, -1)
File "/usr/lib/python2.7/dist-packages/xcb/randr.py", line 56, in __init__
(self.nRates,) = unpack_from('H', parent, offset)
struct.error: unpack_from requires a buffer of at least 2 bytes
because the xserver reply an malformed package, seems caused by this commit https://bugs.freedesktop.org/show_bug.cgi?id=21861#c4
Attachment 91355, "the wireshark caputred packet when run above python code":
randr.pcapng
Edited by Alan Coopersmith