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

2010-05-18 Thread Aurelien Jarno
On Mon, Apr 12, 2010 at 10:51:01AM +0200, 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. > Thi

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