diff options
author | Keith Packard <keithp@keithp.com> | 2010-09-10 11:55:34 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-09-10 11:55:34 -0700 |
commit | bbffb85461eb63bfb1e01e2cb9674607b9221604 (patch) | |
tree | b6937f51d6cbd332eace94957334e0d7963513de /xkb | |
parent | 9a1a4ccbe026f34beca5db3b2243874906961b49 (diff) | |
parent | 71972c2534d490284d3d42b456c2f34b964b2894 (diff) |
Merge remote branch 'whot/for-keith'
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/ddxList.c | 8 | ||||
-rw-r--r-- | xkb/xkb.c | 7 | ||||
-rw-r--r-- | xkb/xkbActions.c | 1 | ||||
-rw-r--r-- | xkb/xkbEvents.c | 9 | ||||
-rw-r--r-- | xkb/xkbLEDs.c | 13 | ||||
-rw-r--r-- | xkb/xkmread.c | 9 |
6 files changed, 25 insertions, 22 deletions
diff --git a/xkb/ddxList.c b/xkb/ddxList.c index 2256424d0..c1ada5c6d 100644 --- a/xkb/ddxList.c +++ b/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 @@ -264,8 +265,7 @@ char tmpname[PATH_MAX]; fclose(in); unlink(tmpname); #endif - if (buf != NULL) - free(buf); + free(buf); return status; } @@ -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/xkb/xkbActions.c b/xkb/xkbActions.c index 8c75301b0..c0204441f 100644 --- a/xkb/xkbActions.c +++ b/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/xkb/xkbEvents.c b/xkb/xkbEvents.c index 8028502b9..c020e5e2a 100644 --- a/xkb/xkbEvents.c +++ b/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/xkb/xkbLEDs.c b/xkb/xkbLEDs.c index f617537cf..515e9b701 100644 --- a/xkb/xkbLEDs.c +++ b/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/xkb/xkmread.c b/xkb/xkmread.c index 814bb1d41..b564195bc 100644 --- a/xkb/xkmread.c +++ b/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; |