ui: check VNC audio frequency limit at time of reading from client
commitcf0706581bc0c24ab2e9a81ff0fc3efa9482c812
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 5 Feb 2018 11:49:37 +0000 (5 11:49 +0000)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 16 Feb 2018 11:33:02 +0000 (16 12:33 +0100)
treee3cb993a75f3bc55d57c64ab8a884418edc547f6
parent52c7c9d076dc64a6d3f1938b5a4994f84744c7fa
ui: check VNC audio frequency limit at time of reading from client

The 'vs->as.freq' value is a signed integer, which is read from an
unsigned 32-bit int field on the wire. There is thus a risk of overflow
on 32-bit platforms. Move the frequency limit checking to be done at
time of read before casting to a signed integer.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180205114938.15784-4-berrange@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/vnc.c