mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-06-16 21:28:28 +02:00
render: Bounds check for nglyphs in ProcRenderAddGlyphs (#28801)
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 5725849a1b)
This commit is contained in:
parent
845f0bb1b9
commit
d5248f0364
1 changed files with 8 additions and 0 deletions
|
|
@ -1085,6 +1085,14 @@ ProcRenderAddGlyphs (ClientPtr client)
|
|||
gi = (xGlyphInfo *) (gids + nglyphs);
|
||||
bits = (CARD8 *) (gi + nglyphs);
|
||||
remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs;
|
||||
|
||||
/* protect against bad nglyphs */
|
||||
if (gi < stuff || gi > ((CARD32 *)stuff + client->req_len) ||
|
||||
bits < stuff || bits > ((CARD32 *)stuff + client->req_len)) {
|
||||
err = BadLength;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
for (i = 0; i < nglyphs; i++)
|
||||
{
|
||||
size_t padded_width;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue