Index: programs/Xserver/hw/xfree86/common/xf86MiscExt.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c,v retrieving revision 1.1.1.15 diff -u -r1.1.1.15 xf86MiscExt.c --- programs/Xserver/hw/xfree86/common/xf86MiscExt.c 6 Jul 2004 15:12:40 -0000 1.1.1.15 +++ programs/Xserver/hw/xfree86/common/xf86MiscExt.c 17 Mar 2005 18:39:52 -0000 @@ -166,6 +166,11 @@ *devname = xf86FindOptionValue(pInfo->options, "Device"); pMse = pInfo->private; + if (pMse->magic != MOUSE_MAGIC + || pMse->size != sizeof(*pMse)) + return FALSE; + + mseptr->type = MapMseProtoToMisc(pMse->protocolID); mseptr->baudrate = pMse->baudRate; mseptr->samplerate = pMse->sampleRate; @@ -533,6 +538,11 @@ pInfo = mse->private; pMse = pInfo->private; + + if (pMse->magic != MOUSE_MAGIC + || pMse->size != sizeof(*pMse)) + return MISC_RET_NOMODULE; + oldflags = pMse->mouseFlags; newProtocol = MapMseMiscToProto(mse->type); Index: programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h,v retrieving revision 1.1.1.21 diff -u -r1.1.1.21 xf86OSmouse.h --- programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h 1 Nov 2004 16:46:39 -0000 1.1.1.21 +++ programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h 17 Mar 2005 18:39:52 -0000 @@ -204,7 +204,11 @@ int dx, int dy, int dz, int dw); typedef void (*MouseCommonOptProc)(InputInfoPtr pInfo); +#define MOUSE_MAGIC 15031995 + typedef struct _MouseDevRec { + unsigned long magic; + int size; PtrCtrlProcPtr Ctrl; PostMseEventProc PostEvent; MouseCommonOptProc CommonOptions;