Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
266b5554
Commit
266b5554
authored
Oct 10, 2011
by
Reinhard Tartler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Imported nxagent-3.1.0-7.tar.gz
Summary: Imported nxagent-3.1.0-7.tar.gz Keywords: Imported nxagent-3.1.0-7.tar.gz into Git repository
parent
3e7c6697
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
173 additions
and
24 deletions
+173
-24
CHANGELOG
nx-X11/programs/Xserver/hw/nxagent/CHANGELOG
+10
-0
Drawable.c
nx-X11/programs/Xserver/hw/nxagent/Drawable.c
+16
-0
NXdixfonts.c
nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c
+7
-0
NXdixfonts.c.NX.original
...11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original
+7
-0
NXdixfonts.c.X.original
nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.X.original
+7
-0
NXshm.c
nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c
+42
-8
NXshm.c.NX.original
nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original
+42
-8
NXshm.c.X.original
nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.X.original
+42
-8
No files found.
nx-X11/programs/Xserver/hw/nxagent/CHANGELOG
View file @
266b5554
ChangeLog:
ChangeLog:
nxagent-3.1.0-7
- Imported patch fixing issues from X.Org security advisory, January
17th, 2008: Multiple vulnerabilities in the X server. CVE IDs:
CVE-2007-5760 CVE-2007-5958 CVE-2007-6427 CVE-2007-6428
CVE-2007-6429 CVE-2008-0006.
- Handled the case if nxagentCreateDrawableBitmap() fails to create
the pixmap intended to store the bitmap data.
nxagent-3.1.0-6
nxagent-3.1.0-6
- Fixed a compile warning in Args.c.
- Fixed a compile warning in Args.c.
...
...
nx-X11/programs/Xserver/hw/nxagent/Drawable.c
View file @
266b5554
...
@@ -2609,8 +2609,24 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
...
@@ -2609,8 +2609,24 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
goto
nxagentCreateDrawableBitmapEnd
;
goto
nxagentCreateDrawableBitmapEnd
;
}
}
/*
* FIXME: A better way it would be create the bitmap
* with the same extents of the clipRegion. This
* requires to save the offset with respect to the
* drawable origin like in the backing store.
*/
pBitmap
=
nxagentCreatePixmap
(
pDrawable
->
pScreen
,
pDrawable
->
width
,
pDrawable
->
height
,
pDrawable
->
depth
);
pBitmap
=
nxagentCreatePixmap
(
pDrawable
->
pScreen
,
pDrawable
->
width
,
pDrawable
->
height
,
pDrawable
->
depth
);
if
(
pBitmap
==
NULL
)
{
#ifdef WARNING
fprintf
(
stderr
,
"nxagentCreateDrawableBitmap: Cannot create pixmap for the bitmap data.
\n
"
);
#endif
goto
nxagentCreateDrawableBitmapEnd
;
}
pGC
=
GetScratchGC
(
pBitmap
->
drawable
.
depth
,
pBitmap
->
drawable
.
pScreen
);
pGC
=
GetScratchGC
(
pBitmap
->
drawable
.
depth
,
pBitmap
->
drawable
.
pScreen
);
ValidateGC
((
DrawablePtr
)
pBitmap
,
pGC
);
ValidateGC
((
DrawablePtr
)
pBitmap
,
pGC
);
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c
View file @
266b5554
...
@@ -437,6 +437,13 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
...
@@ -437,6 +437,13 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
err
=
BadFontName
;
err
=
BadFontName
;
goto
bail
;
goto
bail
;
}
}
/* check values for firstCol, lastCol, firstRow, and lastRow */
if
(
pfont
->
info
.
firstCol
>
pfont
->
info
.
lastCol
||
pfont
->
info
.
firstRow
>
pfont
->
info
.
lastRow
||
pfont
->
info
.
lastCol
-
pfont
->
info
.
firstCol
>
255
)
{
err
=
AllocError
;
goto
bail
;
}
if
(
!
pfont
->
fpe
)
if
(
!
pfont
->
fpe
)
pfont
->
fpe
=
fpe
;
pfont
->
fpe
=
fpe
;
pfont
->
refcnt
++
;
pfont
->
refcnt
++
;
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original
View file @
266b5554
...
@@ -437,6 +437,13 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
...
@@ -437,6 +437,13 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
err = BadFontName;
err = BadFontName;
goto bail;
goto bail;
}
}
/* check values for firstCol, lastCol, firstRow, and lastRow */
if (pfont->info.firstCol > pfont->info.lastCol ||
pfont->info.firstRow > pfont->info.lastRow ||
pfont->info.lastCol - pfont->info.firstCol > 255) {
err = AllocError;
goto bail;
}
if (!pfont->fpe)
if (!pfont->fpe)
pfont->fpe = fpe;
pfont->fpe = fpe;
pfont->refcnt++;
pfont->refcnt++;
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.X.original
View file @
266b5554
...
@@ -336,6 +336,13 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
...
@@ -336,6 +336,13 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
err = BadFontName;
err = BadFontName;
goto bail;
goto bail;
}
}
/* check values for firstCol, lastCol, firstRow, and lastRow */
if (pfont->info.firstCol > pfont->info.lastCol ||
pfont->info.firstRow > pfont->info.lastRow ||
pfont->info.lastCol - pfont->info.firstCol > 255) {
err = AllocError;
goto bail;
}
if (!pfont->fpe)
if (!pfont->fpe)
pfont->fpe = fpe;
pfont->fpe = fpe;
pfont->refcnt++;
pfont->refcnt++;
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c
View file @
266b5554
...
@@ -832,6 +832,8 @@ ProcPanoramiXShmCreatePixmap(
...
@@ -832,6 +832,8 @@ ProcPanoramiXShmCreatePixmap(
int
i
,
j
,
result
;
int
i
,
j
,
result
;
ShmDescPtr
shmdesc
;
ShmDescPtr
shmdesc
;
REQUEST
(
xShmCreatePixmapReq
);
REQUEST
(
xShmCreatePixmapReq
);
unsigned
int
width
,
height
,
depth
;
unsigned
long
size
;
PanoramiXRes
*
newPix
;
PanoramiXRes
*
newPix
;
REQUEST_SIZE_MATCH
(
xShmCreatePixmapReq
);
REQUEST_SIZE_MATCH
(
xShmCreatePixmapReq
);
...
@@ -841,11 +843,18 @@ ProcPanoramiXShmCreatePixmap(
...
@@ -841,11 +843,18 @@ ProcPanoramiXShmCreatePixmap(
LEGAL_NEW_RESOURCE
(
stuff
->
pid
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
pid
,
client
);
VERIFY_GEOMETRABLE
(
pDraw
,
stuff
->
drawable
,
client
);
VERIFY_GEOMETRABLE
(
pDraw
,
stuff
->
drawable
,
client
);
VERIFY_SHMPTR
(
stuff
->
shmseg
,
stuff
->
offset
,
TRUE
,
shmdesc
,
client
);
VERIFY_SHMPTR
(
stuff
->
shmseg
,
stuff
->
offset
,
TRUE
,
shmdesc
,
client
);
if
(
!
stuff
->
width
||
!
stuff
->
height
)
width
=
stuff
->
width
;
height
=
stuff
->
height
;
depth
=
stuff
->
depth
;
if
(
!
width
||
!
height
||
!
depth
)
{
{
client
->
errorValue
=
0
;
client
->
errorValue
=
0
;
return
BadValue
;
return
BadValue
;
}
}
if
(
width
>
32767
||
height
>
32767
)
return
BadAlloc
;
if
(
stuff
->
depth
!=
1
)
if
(
stuff
->
depth
!=
1
)
{
{
pDepth
=
pDraw
->
pScreen
->
allowedDepths
;
pDepth
=
pDraw
->
pScreen
->
allowedDepths
;
...
@@ -855,10 +864,18 @@ ProcPanoramiXShmCreatePixmap(
...
@@ -855,10 +864,18 @@ ProcPanoramiXShmCreatePixmap(
client
->
errorValue
=
stuff
->
depth
;
client
->
errorValue
=
stuff
->
depth
;
return
BadValue
;
return
BadValue
;
}
}
CreatePmap
:
CreatePmap
:
VERIFY_SHMSIZE
(
shmdesc
,
stuff
->
offset
,
size
=
PixmapBytePad
(
width
,
depth
)
*
height
;
PixmapBytePad
(
stuff
->
width
,
stuff
->
depth
)
*
stuff
->
height
,
if
(
sizeof
(
size
)
==
4
&&
BitsPerPixel
(
depth
)
>
8
)
{
client
);
if
(
size
<
width
*
height
)
return
BadAlloc
;
/* thankfully, offset is unsigned */
if
(
stuff
->
offset
+
size
<
size
)
return
BadAlloc
;
}
VERIFY_SHMSIZE
(
shmdesc
,
stuff
->
offset
,
size
,
client
);
if
(
!
(
newPix
=
(
PanoramiXRes
*
)
xalloc
(
sizeof
(
PanoramiXRes
))))
if
(
!
(
newPix
=
(
PanoramiXRes
*
)
xalloc
(
sizeof
(
PanoramiXRes
))))
return
BadAlloc
;
return
BadAlloc
;
...
@@ -1174,6 +1191,8 @@ ProcShmCreatePixmap(client)
...
@@ -1174,6 +1191,8 @@ ProcShmCreatePixmap(client)
register
int
i
;
register
int
i
;
ShmDescPtr
shmdesc
;
ShmDescPtr
shmdesc
;
REQUEST
(
xShmCreatePixmapReq
);
REQUEST
(
xShmCreatePixmapReq
);
unsigned
int
width
,
height
,
depth
;
unsigned
long
size
;
REQUEST_SIZE_MATCH
(
xShmCreatePixmapReq
);
REQUEST_SIZE_MATCH
(
xShmCreatePixmapReq
);
client
->
errorValue
=
stuff
->
pid
;
client
->
errorValue
=
stuff
->
pid
;
...
@@ -1182,11 +1201,18 @@ ProcShmCreatePixmap(client)
...
@@ -1182,11 +1201,18 @@ ProcShmCreatePixmap(client)
LEGAL_NEW_RESOURCE
(
stuff
->
pid
,
client
);
LEGAL_NEW_RESOURCE
(
stuff
->
pid
,
client
);
VERIFY_GEOMETRABLE
(
pDraw
,
stuff
->
drawable
,
client
);
VERIFY_GEOMETRABLE
(
pDraw
,
stuff
->
drawable
,
client
);
VERIFY_SHMPTR
(
stuff
->
shmseg
,
stuff
->
offset
,
TRUE
,
shmdesc
,
client
);
VERIFY_SHMPTR
(
stuff
->
shmseg
,
stuff
->
offset
,
TRUE
,
shmdesc
,
client
);
if
(
!
stuff
->
width
||
!
stuff
->
height
)
width
=
stuff
->
width
;
height
=
stuff
->
height
;
depth
=
stuff
->
depth
;
if
(
!
width
||
!
height
||
!
depth
)
{
{
client
->
errorValue
=
0
;
client
->
errorValue
=
0
;
return
BadValue
;
return
BadValue
;
}
}
if
(
width
>
32767
||
height
>
32767
)
return
BadAlloc
;
if
(
stuff
->
depth
!=
1
)
if
(
stuff
->
depth
!=
1
)
{
{
pDepth
=
pDraw
->
pScreen
->
allowedDepths
;
pDepth
=
pDraw
->
pScreen
->
allowedDepths
;
...
@@ -1196,10 +1222,18 @@ ProcShmCreatePixmap(client)
...
@@ -1196,10 +1222,18 @@ ProcShmCreatePixmap(client)
client
->
errorValue
=
stuff
->
depth
;
client
->
errorValue
=
stuff
->
depth
;
return
BadValue
;
return
BadValue
;
}
}
CreatePmap
:
CreatePmap
:
VERIFY_SHMSIZE
(
shmdesc
,
stuff
->
offset
,
size
=
PixmapBytePad
(
width
,
depth
)
*
height
;
PixmapBytePad
(
stuff
->
width
,
stuff
->
depth
)
*
stuff
->
height
,
if
(
sizeof
(
size
)
==
4
&&
BitsPerPixel
(
depth
)
>
8
)
{
client
);
if
(
size
<
width
*
height
)
return
BadAlloc
;
/* thankfully, offset is unsigned */
if
(
stuff
->
offset
+
size
<
size
)
return
BadAlloc
;
}
VERIFY_SHMSIZE
(
shmdesc
,
stuff
->
offset
,
size
,
client
);
pMap
=
(
*
shmFuncs
[
pDraw
->
pScreen
->
myNum
]
->
CreatePixmap
)(
pMap
=
(
*
shmFuncs
[
pDraw
->
pScreen
->
myNum
]
->
CreatePixmap
)(
pDraw
->
pScreen
,
stuff
->
width
,
pDraw
->
pScreen
,
stuff
->
width
,
stuff
->
height
,
stuff
->
depth
,
stuff
->
height
,
stuff
->
depth
,
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original
View file @
266b5554
...
@@ -832,6 +832,8 @@ ProcPanoramiXShmCreatePixmap(
...
@@ -832,6 +832,8 @@ ProcPanoramiXShmCreatePixmap(
int i, j, result;
int i, j, result;
ShmDescPtr shmdesc;
ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq);
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth;
unsigned long size;
PanoramiXRes *newPix;
PanoramiXRes *newPix;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
...
@@ -841,11 +843,18 @@ ProcPanoramiXShmCreatePixmap(
...
@@ -841,11 +843,18 @@ ProcPanoramiXShmCreatePixmap(
LEGAL_NEW_RESOURCE(stuff->pid, client);
LEGAL_NEW_RESOURCE(stuff->pid, client);
VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client);
VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
if (!stuff->width || !stuff->height)
width = stuff->width;
height = stuff->height;
depth = stuff->depth;
if (!width || !height || !depth)
{
{
client->errorValue = 0;
client->errorValue = 0;
return BadValue;
return BadValue;
}
}
if (width > 32767 || height > 32767)
return BadAlloc;
if (stuff->depth != 1)
if (stuff->depth != 1)
{
{
pDepth = pDraw->pScreen->allowedDepths;
pDepth = pDraw->pScreen->allowedDepths;
...
@@ -855,10 +864,18 @@ ProcPanoramiXShmCreatePixmap(
...
@@ -855,10 +864,18 @@ ProcPanoramiXShmCreatePixmap(
client->errorValue = stuff->depth;
client->errorValue = stuff->depth;
return BadValue;
return BadValue;
}
}
CreatePmap:
CreatePmap:
VERIFY_SHMSIZE(shmdesc, stuff->offset,
size = PixmapBytePad(width, depth) * height;
PixmapBytePad(stuff->width, stuff->depth) * stuff->height,
if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) {
client);
if (size < width * height)
return BadAlloc;
/* thankfully, offset is unsigned */
if (stuff->offset + size < size)
return BadAlloc;
}
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
return BadAlloc;
return BadAlloc;
...
@@ -1174,6 +1191,8 @@ ProcShmCreatePixmap(client)
...
@@ -1174,6 +1191,8 @@ ProcShmCreatePixmap(client)
register int i;
register int i;
ShmDescPtr shmdesc;
ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq);
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth;
unsigned long size;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
client->errorValue = stuff->pid;
client->errorValue = stuff->pid;
...
@@ -1182,11 +1201,18 @@ ProcShmCreatePixmap(client)
...
@@ -1182,11 +1201,18 @@ ProcShmCreatePixmap(client)
LEGAL_NEW_RESOURCE(stuff->pid, client);
LEGAL_NEW_RESOURCE(stuff->pid, client);
VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client);
VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
if (!stuff->width || !stuff->height)
width = stuff->width;
height = stuff->height;
depth = stuff->depth;
if (!width || !height || !depth)
{
{
client->errorValue = 0;
client->errorValue = 0;
return BadValue;
return BadValue;
}
}
if (width > 32767 || height > 32767)
return BadAlloc;
if (stuff->depth != 1)
if (stuff->depth != 1)
{
{
pDepth = pDraw->pScreen->allowedDepths;
pDepth = pDraw->pScreen->allowedDepths;
...
@@ -1196,10 +1222,18 @@ ProcShmCreatePixmap(client)
...
@@ -1196,10 +1222,18 @@ ProcShmCreatePixmap(client)
client->errorValue = stuff->depth;
client->errorValue = stuff->depth;
return BadValue;
return BadValue;
}
}
CreatePmap:
CreatePmap:
VERIFY_SHMSIZE(shmdesc, stuff->offset,
size = PixmapBytePad(width, depth) * height;
PixmapBytePad(stuff->width, stuff->depth) * stuff->height,
if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) {
client);
if (size < width * height)
return BadAlloc;
/* thankfully, offset is unsigned */
if (stuff->offset + size < size)
return BadAlloc;
}
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
pMap = (*shmFuncs[pDraw->pScreen->myNum]->CreatePixmap)(
pMap = (*shmFuncs[pDraw->pScreen->myNum]->CreatePixmap)(
pDraw->pScreen, stuff->width,
pDraw->pScreen, stuff->width,
stuff->height, stuff->depth,
stuff->height, stuff->depth,
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.X.original
View file @
266b5554
...
@@ -728,6 +728,8 @@ ProcPanoramiXShmCreatePixmap(
...
@@ -728,6 +728,8 @@ ProcPanoramiXShmCreatePixmap(
int i, j, result;
int i, j, result;
ShmDescPtr shmdesc;
ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq);
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth;
unsigned long size;
PanoramiXRes *newPix;
PanoramiXRes *newPix;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
...
@@ -737,11 +739,18 @@ ProcPanoramiXShmCreatePixmap(
...
@@ -737,11 +739,18 @@ ProcPanoramiXShmCreatePixmap(
LEGAL_NEW_RESOURCE(stuff->pid, client);
LEGAL_NEW_RESOURCE(stuff->pid, client);
VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client);
VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
if (!stuff->width || !stuff->height)
width = stuff->width;
height = stuff->height;
depth = stuff->depth;
if (!width || !height || !depth)
{
{
client->errorValue = 0;
client->errorValue = 0;
return BadValue;
return BadValue;
}
}
if (width > 32767 || height > 32767)
return BadAlloc;
if (stuff->depth != 1)
if (stuff->depth != 1)
{
{
pDepth = pDraw->pScreen->allowedDepths;
pDepth = pDraw->pScreen->allowedDepths;
...
@@ -751,10 +760,18 @@ ProcPanoramiXShmCreatePixmap(
...
@@ -751,10 +760,18 @@ ProcPanoramiXShmCreatePixmap(
client->errorValue = stuff->depth;
client->errorValue = stuff->depth;
return BadValue;
return BadValue;
}
}
CreatePmap:
CreatePmap:
VERIFY_SHMSIZE(shmdesc, stuff->offset,
size = PixmapBytePad(width, depth) * height;
PixmapBytePad(stuff->width, stuff->depth) * stuff->height,
if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) {
client);
if (size < width * height)
return BadAlloc;
/* thankfully, offset is unsigned */
if (stuff->offset + size < size)
return BadAlloc;
}
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
return BadAlloc;
return BadAlloc;
...
@@ -1052,6 +1069,8 @@ ProcShmCreatePixmap(client)
...
@@ -1052,6 +1069,8 @@ ProcShmCreatePixmap(client)
register int i;
register int i;
ShmDescPtr shmdesc;
ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq);
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth;
unsigned long size;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
client->errorValue = stuff->pid;
client->errorValue = stuff->pid;
...
@@ -1060,11 +1079,18 @@ ProcShmCreatePixmap(client)
...
@@ -1060,11 +1079,18 @@ ProcShmCreatePixmap(client)
LEGAL_NEW_RESOURCE(stuff->pid, client);
LEGAL_NEW_RESOURCE(stuff->pid, client);
VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client);
VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
if (!stuff->width || !stuff->height)
width = stuff->width;
height = stuff->height;
depth = stuff->depth;
if (!width || !height || !depth)
{
{
client->errorValue = 0;
client->errorValue = 0;
return BadValue;
return BadValue;
}
}
if (width > 32767 || height > 32767)
return BadAlloc;
if (stuff->depth != 1)
if (stuff->depth != 1)
{
{
pDepth = pDraw->pScreen->allowedDepths;
pDepth = pDraw->pScreen->allowedDepths;
...
@@ -1074,10 +1100,18 @@ ProcShmCreatePixmap(client)
...
@@ -1074,10 +1100,18 @@ ProcShmCreatePixmap(client)
client->errorValue = stuff->depth;
client->errorValue = stuff->depth;
return BadValue;
return BadValue;
}
}
CreatePmap:
CreatePmap:
VERIFY_SHMSIZE(shmdesc, stuff->offset,
size = PixmapBytePad(width, depth) * height;
PixmapBytePad(stuff->width, stuff->depth) * stuff->height,
if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) {
client);
if (size < width * height)
return BadAlloc;
/* thankfully, offset is unsigned */
if (stuff->offset + size < size)
return BadAlloc;
}
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
pMap = (*shmFuncs[pDraw->pScreen->myNum]->CreatePixmap)(
pMap = (*shmFuncs[pDraw->pScreen->myNum]->CreatePixmap)(
pDraw->pScreen, stuff->width,
pDraw->pScreen, stuff->width,
stuff->height, stuff->depth,
stuff->height, stuff->depth,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment