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

2010-03-27 Thread Aurelien Jarno
On Wed, Mar 03, 2010 at 03:32:43PM +0100, Jens Osterkamp wrote: > 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 f

[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 +++