mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-06 20:58:17 +02:00
Destroying RandR crtc or output overwrites memory.
RRCrtcDestroyResource and RROutputDestroyResource had matching bugs that would overwrite memory past the end of the storage of the crtc or output arrays. Oops.
This commit is contained in:
parent
ec83d67416
commit
4202b23ed8
2 changed files with 2 additions and 2 deletions
|
|
@ -344,7 +344,7 @@ RRCrtcDestroyResource (pointer value, XID pid)
|
|||
if (pScrPriv->crtcs[i] == crtc)
|
||||
{
|
||||
memmove (pScrPriv->crtcs + i, pScrPriv->crtcs + i + 1,
|
||||
(pScrPriv->numCrtcs - (i - 1)) * sizeof (RRCrtcPtr));
|
||||
(pScrPriv->numCrtcs - (i + 1)) * sizeof (RRCrtcPtr));
|
||||
--pScrPriv->numCrtcs;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ RROutputDestroyResource (pointer value, XID pid)
|
|||
if (pScrPriv->outputs[i] == output)
|
||||
{
|
||||
memmove (pScrPriv->outputs + i, pScrPriv->outputs + i + 1,
|
||||
(pScrPriv->numOutputs - (i - 1)) * sizeof (RROutputPtr));
|
||||
(pScrPriv->numOutputs - (i + 1)) * sizeof (RROutputPtr));
|
||||
--pScrPriv->numOutputs;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue