diff options
author | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-09-17 12:07:22 +0000 |
---|---|---|
committer | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-09-17 12:07:22 +0000 |
commit | 11c00b52bed44665dc8cf8826b47b276bf487e6f (patch) | |
tree | 7677eb2caf4e89e91fdec1be100dcb210a5941f3 | |
parent | f495d623b2af4b13481ffafbf9a758773a47e304 (diff) |
#bug 1402: fix Xnest crash if SHM is not available but compiled in
-rw-r--r-- | Xext/xf86bigfont.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index dec2c181e..ac77dda03 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -471,13 +471,16 @@ ProcXF86BigfontQueryFont( if (nCharInfos > 0) { #ifdef HAS_SHM - pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex); + if (!badSysCall) + pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex); + else + pDesc = NULL; if (pDesc) { pCI = (xCharInfo *) pDesc->attach_addr; if (stuff_flags & XF86Bigfont_FLAGS_Shm) shmid = pDesc->shmid; } else { - if (stuff_flags & XF86Bigfont_FLAGS_Shm) + if (stuff_flags & XF86Bigfont_FLAGS_Shm && !badSysCall) pDesc = shmalloc(nCharInfos * sizeof(xCharInfo) + sizeof(CARD32)); if (pDesc) { @@ -522,7 +525,7 @@ ProcXF86BigfontQueryFont( } } #ifdef HAS_SHM - if (pDesc) { + if (pDesc && !badSysCall) { *(CARD32 *)(pCI + nCharInfos) = signature; if (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) { shmdealloc(pDesc); |