• Olivier Fourdan's avatar
    xkb: Don't swap XkbSetGeometry data in the input buffer · 81c90dc8
    Olivier Fourdan authored
    The XkbSetGeometry request embeds data which needs to be swapped when the
    server and the client have different endianess.
    
    _XkbSetGeometry() invokes functions that swap these data directly in the
    input buffer.
    
    However, ProcXkbSetGeometry() may call _XkbSetGeometry() more than once
    (if there is more than one keyboard), thus causing on swapped clients the
    same data to be swapped twice in memory, further causing a server crash
    because the strings lengths on the second time are way off bounds.
    
    To allow _XkbSetGeometry() to run reliably more than once with swapped
    clients, do not swap the data in the buffer, use variables instead.
    Signed-off-by: 's avatarOlivier Fourdan <ofourdan@redhat.com>
    Signed-off-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
    81c90dc8
xkb.c 219 KB