]> xenbits.xensource.com Git - libvirt.git/commit
virDomainSendKey: validate codeset argument
authorIlias Stamatis <stamatis.iliass@gmail.com>
Sat, 1 Jun 2019 12:40:12 +0000 (14:40 +0200)
committerErik Skultety <eskultet@redhat.com>
Tue, 4 Jun 2019 06:31:14 +0000 (08:31 +0200)
commiteee8427a1c7a7e8015559a97ea76bac776cc3966
treea3e8300895fd7d65f59f3c5ef54b544836938cb3
parentcd3aebe9f2f10db44fc2adaf3ab2b263a2a72eac
virDomainSendKey: validate codeset argument

This argument wasn't validated anywhere, neither in the generic
implementation nor in the individual drivers. As a result a call to this
function with a large enough codeset value prior to this change causes
libvirtd to crash.

This happens because all drivers call virKeycodeValueTranslate which
uses codeset as an index to the virKeymapValues array, causing an
out-of-bounds error.

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/libvirt-domain.c