[Qemu-devel] [PATCH v2] qemu-kvm: avoid strlen of NULL pointer

2010-04-12 Thread Jens Osterkamp
If the user wants to create a chardev of type socket but forgets to give a host= option, qemu_opt_get returns NULL. This NULL pointer is then fed into strlen a few lines below without a check which results in a segfault. This fixes it. Signed-off-by: Jens Osterkamp --- qemu-sockets.c |3

[Qemu-devel] [PATCH] qemu-kvm: avoid strlen of NULL pointer

2010-03-03 Thread Jens Osterkamp
If the user wants to create a chardev of type socket but forgets to give a host= option, qemu_opt_get returns NULL. This NULL pointer is then fed into strlen a few lines below without a check which results in a segfault. This fixes it. Signed-off-by: Jens Osterkamp --- qemu-sockets.c |3