summaryrefslogtreecommitdiff
path: root/synclient.c
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2003-05-02 13:16:55 +0200
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:00:54 +0200
commitcd1921948629a75b5c88528fd6a8413b0e856190 (patch)
treea0fce888d41ade9c34d8468f07b6cd2bea88f6b3 /synclient.c
parent92b799709aa862d06f7b6c9ad9e3a36f88943078 (diff)
Fix use of uninitialized memory in synclient.c.
Diffstat (limited to 'synclient.c')
-rw-r--r--synclient.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/synclient.c b/synclient.c
index e12a5ce..43df589 100644
--- a/synclient.c
+++ b/synclient.c
@@ -4,6 +4,7 @@
#include <sys/ipc.h>
#include <sys/shm.h>
#include <unistd.h>
+#include <string.h>
#include <X11/Xdefs.h>
#include "synaptics.h"
@@ -25,6 +26,8 @@ int main()
SynapticsSHM *synshm;
int shmid;
SynapticsSHM old;
+ memset(&old, 0, sizeof(SynapticsSHM));
+ old.x = -1; /* Force first equality test to fail */
if((shmid = shmget(SHM_SYNAPTICS, sizeof(SynapticsSHM), 0)) == -1) {
if ((shmid = shmget(SHM_SYNAPTICS, 0, 0)) == -1) {