spice-app: avoid crash when core spice module doesn't loaded
commit122e4ef6dea14a078a860ca253852e18ddebb8e2
authorBruce Rogers <brogers@suse.com>
Sat, 13 Feb 2021 03:23:18 +0000 (12 20:23 -0700)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 19 Feb 2021 14:00:13 +0000 (19 15:00 +0100)
tree517ea930b3c6f6a9004cd1ec71cac56be86f7843
parentc0ff29d1889040a61a7120731ac16e0c1da39149
spice-app: avoid crash when core spice module doesn't loaded

When qemu is built with modules, but a given module doesn't load
qemu should handle that gracefully. When ui-spice-core.so isn't
able to be loaded and qemu is invoked with -display spice-app or
-spice, qemu will dereference a null pointer. With this change we
check the pointer before dereferencing and error out in a normal
way.

Signed-off-by: Bruce Rogers <brogers@suse.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210213032318.346093-1-brogers@suse.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/spice-app.c