[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/2] spice: add sanity check for spice ports
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 1/2] spice: add sanity check for spice ports |
Date: |
Wed, 20 Jul 2011 12:25:37 +0200 |
Make sure at least one port (port=.. or tls-port=...)
is specified. Also apply range checks to the port numbers.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/spice-core.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/ui/spice-core.c b/ui/spice-core.c
index e142452..1100417 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -480,7 +480,16 @@ void qemu_spice_init(void)
port = qemu_opt_get_number(opts, "port", 0);
tls_port = qemu_opt_get_number(opts, "tls-port", 0);
if (!port && !tls_port) {
- return;
+ fprintf(stderr, "neither port nor tls-port specified for spice.");
+ exit(1);
+ }
+ if (port < 0 || port > 65535) {
+ fprintf(stderr, "spice port is out of range");
+ exit(1);
+ }
+ if (tls_port < 0 || tls_port > 65535) {
+ fprintf(stderr, "spice tls-port is out of range");
+ exit(1);
}
password = qemu_opt_get(opts, "password");
--
1.7.1
- [Qemu-devel] [PATCH 7/9] qxl: make sure primary surface is saved on migration, (continued)
- [Qemu-devel] [PATCH 7/9] qxl: make sure primary surface is saved on migration, Gerd Hoffmann, 2011/07/04
- [Qemu-devel] [PATCH 8/9] qxl: put QXL_IO_UPDATE_IRQ into vgamode whitelist, Gerd Hoffmann, 2011/07/04
- [Qemu-devel] [PATCH 6/9] qxl: add dev id to guest prints, Gerd Hoffmann, 2011/07/04
- [Qemu-devel] [PATCH 1/9] qxl: device id fixup, Gerd Hoffmann, 2011/07/04
- [Qemu-devel] [PATCH 4/9] qxl: interface_get_command: fix reported mode, Gerd Hoffmann, 2011/07/04
- [Qemu-devel] [PATCH 9/9] qxl: allow QXL_IO_LOG also in vga, Gerd Hoffmann, 2011/07/04
- Re: [Qemu-devel] [PULL] spice patch queue, Gerd Hoffmann, 2011/07/12
- Re: [Qemu-devel] [PULL] spice patch queue, Anthony Liguori, 2011/07/19
- [Qemu-devel] [PULL] spice patch queue, Gerd Hoffmann, 2011/07/20