diff options
Diffstat (limited to 'xorg-server/xkb')
-rw-r--r-- | xorg-server/xkb/ddxList.c | 8 | ||||
-rw-r--r-- | xorg-server/xkb/xkb.c | 7 | ||||
-rw-r--r-- | xorg-server/xkb/xkbActions.c | 1 | ||||
-rw-r--r-- | xorg-server/xkb/xkbEvents.c | 9 | ||||
-rw-r--r-- | xorg-server/xkb/xkbLEDs.c | 13 | ||||
-rw-r--r-- | xorg-server/xkb/xkmread.c | 9 |
6 files changed, 25 insertions, 22 deletions
diff --git a/xorg-server/xkb/ddxList.c b/xorg-server/xkb/ddxList.c index e4e32075b..f23effa97 100644 --- a/xorg-server/xkb/ddxList.c +++ b/xorg-server/xkb/ddxList.c @@ -161,6 +161,7 @@ char tmpname[PATH_MAX]; }
if (!in) {
haveDir= FALSE;
+ free(buf);
buf = Xprintf(
"'%s/xkbcomp' '-R%s/%s' -w %ld -l -vlfhpR '%s'" W32_tmparg,
XkbBinDirectory,XkbBaseDirectory,componentDirs[what],(long)
@@ -176,6 +177,7 @@ char tmpname[PATH_MAX]; }
if (!in) {
haveDir= FALSE;
+ free(buf);
buf = Xprintf(
"xkbcomp -R%s -w %ld -l -vlfhpR '%s'" W32_tmparg,
componentDirs[what],(long)
@@ -200,8 +202,7 @@ char tmpname[PATH_MAX]; }
if (!in)
{
- if (buf != NULL)
- free(buf);
+ free(buf);
#ifdef WIN32
unlink(tmpname);
#endif
@@ -269,8 +270,7 @@ char tmpname[PATH_MAX]; fclose(in);
unlink(tmpname);
#endif
- if (buf != NULL)
- free(buf);
+ free(buf);
return status;
}
diff --git a/xorg-server/xkb/xkb.c b/xorg-server/xkb/xkb.c index bba7448f3..89139dc43 100644 --- a/xorg-server/xkb/xkb.c +++ b/xorg-server/xkb/xkb.c @@ -224,7 +224,8 @@ ProcXkbSelectEvents(ClientPtr client) masks = XkbFindClientResource((DevicePtr)dev,client);
if (!masks){
XID id = FakeClientID(client->index);
- AddResource(id,RT_XKBCLIENT,dev);
+ if (!AddResource(id,RT_XKBCLIENT,dev))
+ return BadAlloc;
masks= XkbAddClientResource((DevicePtr)dev,client,id);
}
if (masks) {
@@ -3019,6 +3020,7 @@ register unsigned bit; to = (CARD8 *)wire;
if ((to-map)!=length) {
client->errorValue = _XkbErrCode2(0xff,length);
+ free(map);
return BadLength;
}
}
@@ -5377,7 +5379,8 @@ ProcXkbPerClientFlags(ClientPtr client) }
else if (want && (!interest)) {
XID id = FakeClientID(client->index);
- AddResource(id,RT_XKBCLIENT,dev);
+ if (!AddResource(id,RT_XKBCLIENT,dev))
+ return BadAlloc;
interest= XkbAddClientResource((DevicePtr)dev,client,id);
if (!interest)
return BadAlloc;
diff --git a/xorg-server/xkb/xkbActions.c b/xorg-server/xkb/xkbActions.c index b9614b7aa..7a5f2b241 100644 --- a/xorg-server/xkb/xkbActions.c +++ b/xorg-server/xkb/xkbActions.c @@ -806,6 +806,7 @@ ProcessInputProc backupproc; /* never actually used uninitialised, but gcc isn't smart enough
* to work that out. */
memset(&old, 0, sizeof(old));
+ memset(&ev, 0, sizeof(ev));
if ((filter->keycode!=0)&&(filter->keycode!=keycode))
return 1;
diff --git a/xorg-server/xkb/xkbEvents.c b/xorg-server/xkb/xkbEvents.c index ee62b9947..3780be12d 100644 --- a/xorg-server/xkb/xkbEvents.c +++ b/xorg-server/xkb/xkbEvents.c @@ -1045,15 +1045,6 @@ XkbInterestPtr interest; interest->dev = dev;
interest->client = client;
interest->resource = id;
- interest->stateNotifyMask= 0;
- interest->ctrlsNotifyMask= 0;
- interest->namesNotifyMask= 0;
- interest->compatNotifyMask= 0;
- interest->bellNotifyMask= FALSE;
- interest->accessXNotifyMask= 0;
- interest->iStateNotifyMask= 0;
- interest->iMapNotifyMask= 0;
- interest->altSymsNotifyMask= 0;
interest->next = dev->xkb_interest;
dev->xkb_interest= interest;
return interest;
diff --git a/xorg-server/xkb/xkbLEDs.c b/xorg-server/xkb/xkbLEDs.c index 65d8739be..14767157b 100644 --- a/xorg-server/xkb/xkbLEDs.c +++ b/xorg-server/xkb/xkbLEDs.c @@ -556,6 +556,7 @@ Bool checkNames; else if ((kf!=NULL)&&((kf->xkb_sli->flags&XkbSLI_IsDefault)!=0)) {
XkbDescPtr xkb;
xkb= dev->key->xkbInfo->desc;
+ sli= kf->xkb_sli;
sli->physIndicators= xkb->indicators->phys_indicators;
if (xkb->names->indicators!=sli->names) {
checkNames= TRUE;
@@ -584,6 +585,8 @@ Bool checkNames; sli->maps= NULL;
sli->names= NULL;
}
+ else
+ return NULL;
if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask))
sli->names= calloc(XkbNumIndicators, sizeof(Atom));
if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask))
@@ -714,10 +717,12 @@ XkbSrvLedInfoPtr sli; }
}
}
- if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask))
- sli->names= calloc(XkbNumIndicators, sizeof(Atom));
- if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask))
- sli->maps= calloc(XkbNumIndicators, sizeof(XkbIndicatorMapRec));
+ if (sli) {
+ if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask))
+ sli->names= calloc(XkbNumIndicators, sizeof(Atom));
+ if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask))
+ sli->maps= calloc(XkbNumIndicators, sizeof(XkbIndicatorMapRec));
+ }
return sli;
}
diff --git a/xorg-server/xkb/xkmread.c b/xorg-server/xkb/xkmread.c index 4b2043667..81f09fe3b 100644 --- a/xorg-server/xkb/xkmread.c +++ b/xorg-server/xkb/xkmread.c @@ -534,8 +534,7 @@ XkbAction *act; case XkbSA_XFree86Private:
/* copy the kind of action */
- strncpy((char*)act->any.data, (char*)wire.actionData,
- XkbAnyActionDataSize);
+ memcpy(act->any.data, wire.actionData, XkbAnyActionDataSize);
break ;
case XkbSA_Terminate:
@@ -687,7 +686,11 @@ int nRead=0; if ((tmp=XkmGetCountedString(file,buf,100))<1)
return -1;
nRead+= tmp;
- if ((buf[0]!='\0')&&(xkb->names)) {
+
+ if (!xkb->names)
+ continue;
+
+ if (buf[0]!='\0') {
Atom name;
name= XkbInternAtom(buf,0);
xkb->names->groups[i]= name;
|