Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions Xext/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ SyncCreateSystemCounter(const char *name,
SysCounterInfo *psci = calloc(1, sizeof(SysCounterInfo));
if (!psci) {
FreeResource(pCounter->sync.id, X11_RESTYPE_NONE);
return pCounter;
return NULL;
}
pCounter->pSysCounterInfo = psci;
psci->pCounter = pCounter;
Expand Down Expand Up @@ -2424,8 +2424,7 @@ IdleTimeBlockHandler(void *pCounter, void *wt)
{
SyncCounter *counter = pCounter;
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
if (!priv)
return;
BUG_RETURN(priv == NULL);
int64_t *less = priv->value_less;
int64_t *greater = priv->value_greater;
int64_t idle, old_idle;
Expand Down Expand Up @@ -2516,8 +2515,7 @@ IdleTimeWakeupHandler(void *pCounter, int rc)
{
SyncCounter *counter = pCounter;
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
if (!priv)
return;
BUG_RETURN(priv == NULL);
int64_t *less = priv->value_less;
int64_t *greater = priv->value_greater;
int64_t idle;
Expand Down Expand Up @@ -2551,8 +2549,7 @@ IdleTimeBracketValues(void *pCounter, int64_t *pbracket_less,
{
SyncCounter *counter = pCounter;
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
if (!priv)
return;
BUG_RETURN(priv == NULL);
int64_t *less = priv->value_less;
int64_t *greater = priv->value_greater;
Bool registered = (less || greater);
Expand Down
4 changes: 3 additions & 1 deletion Xext/xselinux_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,10 @@ ProcSELinuxListSelections(ClientPtr client)
count = 0;
for (pSel = CurrentSelections; pSel; pSel = pSel->next)
count++;
if (count == 0)
return SELinuxSendItemsToClient(client, NULL, 0, 0);
items = calloc(count, sizeof(SELinuxListItemRec));
if (count && !items)
if (!items)
return BadAlloc;

/* Fill in the items and calculate size */
Expand Down
6 changes: 5 additions & 1 deletion Xext/xselinux_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,12 @@ SELinuxAtomToSID(Atom atom, int prop, SELinuxObjectRec ** obj_rtn)
rec = SELinuxArrayGet(&arr_atoms, atom);
if (!rec) {
rec = calloc(1, sizeof(SELinuxAtomRec));
if (!rec || !SELinuxArraySet(&arr_atoms, atom, rec))
if (!rec)
return BadAlloc;
if (!SELinuxArraySet(&arr_atoms, atom, rec)) {
free(rec);
return BadAlloc;
}
}

if (prop) {
Expand Down
4 changes: 4 additions & 0 deletions Xext/xtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ ProcXTestFakeInput(ClientPtr client)
return BadAccess;

dev = GetXTestDevice(dev);

/* This can only happen if we passed a slave to GetXTestDevice() */
if (!dev)
return BadAccess;
}


Expand Down
11 changes: 8 additions & 3 deletions Xi/exevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -3233,9 +3233,14 @@ DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask,
inputMasks->dontPropagateMask[maskndx] = mask;
}
else {
if (!inputMasks)
AddExtensionClient(pWin, client, 0, 0);
inputMasks = wOtherInputMasks(pWin);
if (!inputMasks) {
int ret = AddExtensionClient(pWin, client, 0, 0);

if (ret != Success)
return ret;
inputMasks = wOtherInputMasks(pWin);
BUG_RETURN_VAL(!inputMasks, BadAlloc);
}
inputMasks->dontPropagateMask[maskndx] = mask;
}
RecalculateDeviceDeliverableEvents(pWin);
Expand Down
1 change: 1 addition & 0 deletions Xi/getfctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
k2->pitch = k->ctrl.bell_pitch;
k2->duration = k->ctrl.bell_duration;
k2->led_mask = k->ctrl.leds;
k2->led_values = k->ctrl.leds;
k2->global_auto_repeat = k->ctrl.autoRepeat;
for (i = 0; i < 32; i++)
k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
Expand Down