Re: [PATCH] vfb: add a name to the pointer and keyboard
On Mon, Apr 12, 2010 at 11:23:34 +1000, Peter Hutterer wrote: On Fri, Apr 09, 2010 at 03:19:59PM +0200, Julien Cristau wrote: Fixes a crash in XIQueryDevice which calls strlen on a NULL pointer. #0 strlen () at ../sysdeps/x86_64/strlen.S:31 #1 0x004c16ed in SizeDeviceInfo (dev=0x969bd0) at ../../Xi/xiquerydevice.c:204 #2 0x004c1a01 in ProcXIQueryDevice (client=0xa57510) at ../../Xi/xiquerydevice.c:98 Debian bug#575905 http://bugs.debian.org/575905 Reported-by: Bernhard R. Link brl...@debian.org Signed-off-by: Julien Cristau jcris...@debian.org Reviewed-by: Fernando Carrijo fcarr...@yahoo.com.br --- hw/vfb/InitInput.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c index 35d1dc4..1fcd025 100644 --- a/hw/vfb/InitInput.c +++ b/hw/vfb/InitInput.c @@ -139,7 +139,9 @@ InitInput(int argc, char *argv[]) p = AddInputDevice(serverClient, vfbMouseProc, TRUE); k = AddInputDevice(serverClient, vfbKeybdProc, TRUE); RegisterPointerDevice(p); +p-name = xnfstrdup(mouse); RegisterKeyboardDevice(k); +k-name = xnfstrdup(keyboard); (void)mieqInit(); } shouldn't this be using AssignTypeAndName() instead? does mostly the same, but assigning the type too would be nice. Looks like it should, I didn't know about that function. Many bits of kdrive, as well as xquartz and xwin, don't seem to be using it. I'll respin the patch with that change, thanks for the review. Cheers, Julien ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] vfb: add a name to the pointer and keyboard
On Fri, Apr 09, 2010 at 03:19:59PM +0200, Julien Cristau wrote: Fixes a crash in XIQueryDevice which calls strlen on a NULL pointer. #0 strlen () at ../sysdeps/x86_64/strlen.S:31 #1 0x004c16ed in SizeDeviceInfo (dev=0x969bd0) at ../../Xi/xiquerydevice.c:204 #2 0x004c1a01 in ProcXIQueryDevice (client=0xa57510) at ../../Xi/xiquerydevice.c:98 Debian bug#575905 http://bugs.debian.org/575905 Reported-by: Bernhard R. Link brl...@debian.org Signed-off-by: Julien Cristau jcris...@debian.org Reviewed-by: Fernando Carrijo fcarr...@yahoo.com.br --- hw/vfb/InitInput.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c index 35d1dc4..1fcd025 100644 --- a/hw/vfb/InitInput.c +++ b/hw/vfb/InitInput.c @@ -139,7 +139,9 @@ InitInput(int argc, char *argv[]) p = AddInputDevice(serverClient, vfbMouseProc, TRUE); k = AddInputDevice(serverClient, vfbKeybdProc, TRUE); RegisterPointerDevice(p); +p-name = xnfstrdup(mouse); RegisterKeyboardDevice(k); +k-name = xnfstrdup(keyboard); (void)mieqInit(); } shouldn't this be using AssignTypeAndName() instead? does mostly the same, but assigning the type too would be nice. Cheers, Peter ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] vfb: add a name to the pointer and keyboard
On Sat, Apr 3, 2010 at 17:13:27 -0300, Fernando Carrijo wrote: diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c index 35d1dc4..3136e93 100644 --- a/hw/vfb/InitInput.c +++ b/hw/vfb/InitInput.c @@ -139,7 +139,9 @@ InitInput(int argc, char *argv[]) p = AddInputDevice(serverClient, vfbMouseProc, TRUE); k = AddInputDevice(serverClient, vfbKeybdProc, TRUE); RegisterPointerDevice(p); +p-name = strdup(mouse); Under shortage of memory, strdup() will return a NULL pointer. If we're OOM at InitInput time we'll probably have other issues. But yeah, I can make that xnfstrdup() so we'll FatalError instead. Thanks, Julien signature.asc Description: Digital signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] vfb: add a name to the pointer and keyboard
Hi Julien, Julien Cristau jcris...@debian.org wrote: Fixes a crash in XIQueryDevice which calls strlen on a NULL pointer. at ../../Xi/xiquerydevice.c:204 at ../../Xi/xiquerydevice.c:98 Debian bug#575905 http://bugs.debian.org/575905 Reported-by: Bernhard R. Link brl...@debian.org Signed-off-by: Julien Cristau jcris...@debian.org --- hw/vfb/InitInput.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c index 35d1dc4..3136e93 100644 --- a/hw/vfb/InitInput.c +++ b/hw/vfb/InitInput.c @@ -139,7 +139,9 @@ InitInput(int argc, char *argv[]) p = AddInputDevice(serverClient, vfbMouseProc, TRUE); k = AddInputDevice(serverClient, vfbKeybdProc, TRUE); RegisterPointerDevice(p); +p-name = strdup(mouse); Under shortage of memory, strdup() will return a NULL pointer. RegisterKeyboardDevice(k); +k-name = strdup(keyboard); (void)mieqInit(); } -- 1.7.0.3 The same applies for your second patch. With that fixed, Reviewed-by: Fernando Carrijo fcarr...@yahoo.com.br ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] vfb: add a name to the pointer and keyboard
Fixes a crash in XIQueryDevice which calls strlen on a NULL pointer. #0 strlen () at ../sysdeps/x86_64/strlen.S:31 #1 0x004c16ed in SizeDeviceInfo (dev=0x969bd0) at ../../Xi/xiquerydevice.c:204 #2 0x004c1a01 in ProcXIQueryDevice (client=0xa57510) at ../../Xi/xiquerydevice.c:98 Debian bug#575905 http://bugs.debian.org/575905 Reported-by: Bernhard R. Link brl...@debian.org Signed-off-by: Julien Cristau jcris...@debian.org --- Resending with fixed commit message, git had eaten the lines starting with #. hw/vfb/InitInput.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c index 35d1dc4..3136e93 100644 --- a/hw/vfb/InitInput.c +++ b/hw/vfb/InitInput.c @@ -139,7 +139,9 @@ InitInput(int argc, char *argv[]) p = AddInputDevice(serverClient, vfbMouseProc, TRUE); k = AddInputDevice(serverClient, vfbKeybdProc, TRUE); RegisterPointerDevice(p); +p-name = strdup(mouse); RegisterKeyboardDevice(k); +k-name = strdup(keyboard); (void)mieqInit(); } -- 1.7.0.3 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel