autogen.sh | 4 configure.ac | 17 +- include/X11/Xcms.h | 12 + include/X11/Xlib.h | 16 + include/X11/Xlibint.h | 114 ++++++-------- include/X11/Xutil.h | 12 + man/AllPlanes.man | 63 ------- man/BlackPixelOfScreen.man | 37 ---- man/DisplayOfCCC.man | 37 ---- man/ImageByteOrder.man | 71 -------- man/IsCursorKey.man | 63 ------- man/XAddConnectionWatch.man | 63 ------- man/XAddHost.man | 81 --------- man/XAllocClassHint.man | 70 -------- man/XAllocColor.man | 63 ------- man/XAllocIconSize.man | 71 -------- man/XAllocSizeHints.man | 91 +---------- man/XAllocStandardColormap.man | 89 +--------- man/XAllocWMHints.man | 85 +--------- man/XAllowEvents.man | 63 ------- man/XAnyEvent.man | 143 ++++------------- man/XButtonEvent.man | 147 ++++-------------- man/XChangeKeyboardControl.man | 97 +---------- man/XChangeKeyboardMapping.man | 69 -------- man/XChangePointerControl.man | 63 ------- man/XChangeSaveSet.man | 63 ------- man/XChangeWindowAttributes.man | 63 ------- man/XCirculateEvent.man | 79 --------- man/XCirculateRequestEvent.man | 79 --------- man/XClearArea.man | 63 ------- man/XClientMessageEvent.man | 89 +--------- man/XColormapEvent.man | 81 +-------- man/XConfigureEvent.man | 87 +--------- man/XConfigureRequestEvent.man | 89 +--------- man/XConfigureWindow.man | 75 --------- man/XCopyArea.man | 63 ------- man/XCreateColormap.man | 73 -------- man/XCreateFontCursor.man | 63 ------- man/XCreateFontSet.man | 63 ------- man/XCreateGC.man | 116 +++----------- man/XCreateIC.man | 63 ------- man/XCreateOC.man | 63 ------- man/XCreatePixmap.man | 63 ------- man/XCreateRegion.man | 63 ------- man/XCreateWindow.man | 95 +---------- man/XCreateWindowEvent.man | 85 +--------- man/XCrossingEvent.man | 103 ++---------- man/XDefineCursor.man | 63 ------- man/XDestroyWindow.man | 63 ------- man/XDestroyWindowEvent.man | 77 --------- man/XDrawArc.man | 63 ------- man/XDrawImageString.man | 63 ------- man/XDrawLine.man | 67 -------- man/XDrawPoint.man | 67 -------- man/XDrawRectangle.man | 69 -------- man/XDrawString.man | 63 ------- man/XDrawText.man | 83 +--------- man/XEmptyRegion.man | 63 ------- man/XErrorEvent.man | 79 --------- man/XExposeEvent.man | 81 +-------- man/XExtentsOfFontSet.man | 63 ------- man/XFillRectangle.man | 63 ------- man/XFilterEvent.man | 63 ------- man/XFlush.man | 63 ------- man/XFocusChangeEvent.man | 89 +--------- man/XFontSetExtents.man | 69 -------- man/XFontsOfFontSet.man | 63 ------- man/XFree.man | 63 ------- man/XGetEventData.man | 83 +--------- man/XGetVisualInfo.man | 85 +--------- man/XGetWindowAttributes.man | 107 ++----------- man/XGetWindowProperty.man | 63 ------- man/XGrabButton.man | 63 ------- man/XGrabKey.man | 63 ------- man/XGrabKeyboard.man | 63 ------- man/XGrabPointer.man | 63 ------- man/XGrabServer.man | 63 ------- man/XGraphicsExposeEvent.man | 101 ++---------- man/XGravityEvent.man | 79 --------- man/XIconifyWindow.man | 63 ------- man/XIfEvent.man | 63 ------- man/XInitImage.man | 63 ------- man/XInitThreads.man | 63 ------- man/XInstallColormap.man | 63 ------- man/XInternAtom.man | 63 ------- man/XIntersectRegion.man | 63 ------- man/XKeymapEvent.man | 79 --------- man/XListFonts.man | 63 ------- man/XLoadFont.man | 63 ------- man/XLookupKeysym.man | 63 ------- man/XMapEvent.man | 99 ++---------- man/XMapRequestEvent.man | 77 --------- man/XMapWindow.man | 63 ------- man/XNextEvent.man | 63 ------- man/XNoOp.man | 63 ------- man/XOpenDisplay.man | 63 ------- man/XOpenIM.man | 63 ------- man/XOpenOM.man | 63 ------- man/XParseGeometry.man | 63 ------- man/XPolygonRegion.man | 63 ------- man/XPropertyEvent.man | 81 +-------- man/XPutBackEvent.man | 63 ------- man/XPutImage.man | 63 ------- man/XQueryBestSize.man | 63 ------- man/XQueryColor.man | 63 ------- man/XQueryPointer.man | 63 ------- man/XQueryTree.man | 63 ------- man/XRaiseWindow.man | 63 ------- man/XReadBitmapFile.man | 63 ------- man/XRecolorCursor.man | 63 ------- man/XReparentEvent.man | 83 +--------- man/XReparentWindow.man | 63 ------- man/XResizeRequestEvent.man | 77 --------- man/XResourceManagerString.man | 63 ------- man/XSaveContext.man | 63 ------- man/XSelectInput.man | 63 ------- man/XSelectionClearEvent.man | 79 --------- man/XSelectionEvent.man | 83 +--------- man/XSelectionRequestEvent.man | 85 +--------- man/XSendEvent.man | 69 -------- man/XSetArcMode.man | 63 ------- man/XSetClipOrigin.man | 63 ------- man/XSetCloseDownMode.man | 63 ------- man/XSetCommand.man | 63 ------- man/XSetErrorHandler.man | 63 ------- man/XSetFillStyle.man | 63 ------- man/XSetFont.man | 63 ------- man/XSetFontPath.man | 63 ------- man/XSetICFocus.man | 63 ------- man/XSetICValues.man | 63 ------- man/XSetInputFocus.man | 63 ------- man/XSetLineAttributes.man | 63 ------- man/XSetPointerMapping.man | 63 ------- man/XSetScreenSaver.man | 63 ------- man/XSetSelectionOwner.man | 63 ------- man/XSetState.man | 63 ------- man/XSetTextProperty.man | 63 ------- man/XSetTile.man | 63 ------- man/XSetTransientForHint.man | 63 ------- man/XSetWMClientMachine.man | 63 ------- man/XSetWMColormapWindows.man | 63 ------- man/XSetWMIconName.man | 63 ------- man/XSetWMName.man | 63 ------- man/XSetWMProperties.man | 63 ------- man/XSetWMProtocols.man | 63 ------- man/XStoreBytes.man | 63 ------- man/XStoreColors.man | 63 ------- man/XStringListToTextProperty.man | 73 -------- man/XStringToKeysym.man | 63 ------- man/XSupportsLocale.man | 63 ------- man/XSynchronize.man | 63 ------- man/XTextExtents.man | 63 ------- man/XTextWidth.man | 63 ------- man/XTranslateCoordinates.man | 63 ------- man/XUnmapEvent.man | 79 --------- man/XUnmapWindow.man | 63 ------- man/XVaCreateNestedList.man | 63 ------- man/XVisibilityEvent.man | 77 --------- man/XWarpPointer.man | 63 ------- man/XcmsAllocColor.man | 63 ------- man/XcmsCCCOfColormap.man | 63 ------- man/XcmsCIELabQueryMaxC.man | 63 ------- man/XcmsCIELuvQueryMaxC.man | 63 ------- man/XcmsColor.man | 63 ------- man/XcmsConvertColors.man | 63 ------- man/XcmsCreateCCC.man | 63 ------- man/XcmsDefaultCCC.man | 63 ------- man/XcmsQueryBlack.man | 63 ------- man/XcmsQueryColor.man | 63 ------- man/XcmsSetWhitePoint.man | 63 ------- man/XcmsStoreColor.man | 63 ------- man/XcmsTekHVCQueryMaxC.man | 63 ------- man/XmbDrawImageString.man | 63 ------- man/XmbDrawString.man | 63 ------- man/XmbDrawText.man | 83 +--------- man/XmbLookupString.man | 68 -------- man/XmbResetIC.man | 63 ------- man/XmbTextEscapement.man | 63 ------- man/XmbTextExtents.man | 63 ------- man/XmbTextListToTextProperty.man | 85 +--------- man/XmbTextPerCharExtents.man | 63 ------- man/XrmEnumerateDatabase.man | 79 +-------- man/XrmGetFileDatabase.man | 65 -------- man/XrmGetResource.man | 65 -------- man/XrmInitialize.man | 103 ++---------- man/XrmMergeDatabases.man | 65 -------- man/XrmPutResource.man | 65 -------- man/XrmUniqueQuark.man | 65 -------- man/xkb/XkbGetNamedGeometry.man | 4 man/xkb/XkbSAGroup.man | 7 man/xkb/XkbSASetGroup.man | 14 - man/xkb/XkbSetDetectableAutoRepeat.man | 4 man/xkb/XkbSetDeviceButtonActions.man | 4 modules/im/ximcp/Makefile.am | 1 modules/im/ximcp/imCallbk.c | 54 +++--- modules/im/ximcp/imDefFlt.c | 40 ++-- modules/im/ximcp/imDefIc.c | 60 +++---- modules/im/ximcp/imDefIm.c | 96 +++++------ modules/im/ximcp/imDefLkup.c | 74 ++++----- modules/im/ximcp/imDispch.c | 8 modules/im/ximcp/imExten.c | 34 ++-- modules/im/ximcp/imImSw.c | 2 modules/im/ximcp/imInsClbk.c | 14 - modules/im/ximcp/imInt.c | 20 +- modules/im/ximcp/imLcGIc.c | 2 modules/im/ximcp/imLcIc.c | 16 - modules/im/ximcp/imLcIm.c | 34 ++-- modules/im/ximcp/imLcLkup.c | 14 - modules/im/ximcp/imLcPrs.c | 68 ++++++-- modules/im/ximcp/imLcSIc.c | 2 modules/im/ximcp/imRm.c | 220 +++++++++++++-------------- modules/im/ximcp/imRmAttr.c | 48 ++--- modules/im/ximcp/imThaiFlt.c | 98 ++++++------ modules/im/ximcp/imThaiIc.c | 14 - modules/im/ximcp/imThaiIm.c | 8 modules/im/ximcp/imTrX.c | 30 +-- modules/im/ximcp/imTrans.c | 22 +- modules/im/ximcp/imTransR.c | 28 +-- modules/om/generic/omXChar.c | 91 +---------- nls/Makefile.am | 4 nls/compose.dir.pre | 98 +++++++++--- nls/en_US.UTF-8/Compose.pre | 56 +++--- nls/ja.S90/XI18N_OBJS | 7 nls/ja.S90/XLC_LOCALE.pre | 150 ------------------ nls/ja.U90/XI18N_OBJS | 7 nls/ja.U90/XLC_LOCALE.pre | 151 ------------------ nls/ja_JP.UTF-8/Compose.pre | 1 nls/km_KH.UTF-8/Compose.pre | 8 nls/km_KH.UTF-8/XI18N_OBJS | 8 nls/ko_KR.UTF-8/Compose.pre | 1 nls/locale.alias.pre | 254 +++++++++++++++++-------------- nls/locale.dir.pre | 43 +++-- nls/pt_BR.UTF-8/Compose.pre | 52 +++--- nls/sr_CS.UTF-8/Compose.pre | 128 +++++++++++++++ nls/sr_CS.UTF-8/XI18N_OBJS | 8 nls/th_TH.UTF-8/Compose.pre | 1 nls/zh_CN.UTF-8/Compose.pre | 1 nls/zh_HK.UTF-8/Compose.pre | 1 nls/zh_TW.UTF-8/Compose.pre | 1 specs/libX11/CH04.xml | 3 src/AllCells.c | 9 - src/ChProp.c | 6 src/ChWindow.c | 9 - src/Cmap.h | 2 src/ConfWind.c | 13 - src/Context.c | 8 src/Cr.h | 2 src/CrBFData.c | 47 ++--- src/CrGC.c | 2 src/CrPFBData.c | 54 +++--- src/CrWindow.c | 9 - src/Depths.c | 2 src/DrArc.c | 12 - src/DrLine.c | 16 - src/DrPoint.c | 15 - src/DrRect.c | 16 - src/ErrDes.c | 9 - src/FSWrap.c | 6 src/FillArc.c | 16 - src/FillRct.c | 15 - src/Font.c | 134 ++++++---------- src/FontInfo.c | 144 +++++++---------- src/FontNames.c | 35 ++-- src/GetAtomNm.c | 12 - src/GetDflt.c | 27 --- src/GetFPath.c | 36 ++-- src/GetFProp.c | 27 +-- src/GetHints.c | 9 - src/GetImage.c | 12 - src/GetMoEv.c | 26 +-- src/GetPntMap.c | 31 ++- src/GetProp.c | 33 ++-- src/GetRGBCMap.c | 3 src/ImUtil.c | 20 -- src/InitExt.c | 4 src/IntAtom.c | 6 src/Key.h | 3 src/KeyBind.c | 10 - src/KeysymStr.c | 26 +-- src/LiHosts.c | 29 +-- src/LiICmaps.c | 8 src/LiProps.c | 8 src/ListExt.c | 36 ++-- src/Macros.c | 5 src/Makefile.am | 1 src/ModMap.c | 17 +- src/MoveWin.c | 9 - src/OpenDis.c | 27 +-- src/PixFormats.c | 4 src/PolyReg.c | 13 - src/PolyTxt16.c | 23 -- src/PropAlloc.c | 16 - src/PutBEvent.c | 2 src/PutImage.c | 13 - src/QuColors.c | 10 - src/QuTree.c | 8 src/Quarks.c | 13 - src/RdBitF.c | 2 src/Region.c | 19 +- src/RegstFlt.c | 4 src/RestackWs.c | 9 - src/SendEvent.c | 5 src/SetFPath.c | 2 src/SetHints.c | 10 - src/SetPntMap.c | 2 src/StBytes.c | 2 src/StColor.c | 12 - src/StName.c | 6 src/StrKeysym.c | 2 src/StrToText.c | 2 src/Text16.c | 23 -- src/TextToStr.c | 4 src/VisUtil.c | 8 src/WrBitF.c | 2 src/XErrorDB | 1 src/Xintatom.h | 1 src/Xintconn.h | 1 src/XlibAsync.c | 5 src/XlibInt.c | 268 +-------------------------------- src/Xprivate.h | 2 src/Xresinternal.h | 2 src/Xrm.c | 50 +++--- src/globals.c | 121 -------------- src/locking.c | 8 src/locking.h | 2 src/pathmax.h | 81 +++++++++ src/udcInf.c | 17 -- src/xcb_io.c | 17 ++ src/xcms/Makefile.am | 5 src/xcms/cmsColNm.c | 31 ++- src/xcms/cmsMath.c | 4 src/xcms/cmsTrig.c | 4 src/xkb/XKBAlloc.c | 12 - src/xkb/XKBExtDev.c | 6 src/xkb/XKBGAlloc.c | 21 -- src/xkb/XKBGeom.c | 15 + src/xkb/XKBGetMap.c | 33 +++- src/xkb/XKBMAlloc.c | 13 - src/xkb/XKBMisc.c | 13 - src/xkb/XKBNames.c | 58 ------- src/xkb/XKBRdBuf.c | 28 --- src/xkb/XKBlibint.h | 2 src/xlibi18n/XimTrInt.h | 2 src/xlibi18n/Ximint.h | 7 src/xlibi18n/lcFile.c | 24 -- 345 files changed, 2563 insertions(+), 14421 deletions(-)
New commits: commit 655d631e86c95b14888758b27ed2836ca3e3ce86 Author: Alan Coopersmith <[email protected]> Date: Mon Jun 3 19:21:06 2013 -0700 libX11 1.6.0 Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/configure.ac b/configure.ac index 1f24bd2..f533f3c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([libX11], [1.5.99.902], +AC_INIT([libX11], [1.6.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libX11]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([src/config.h include/X11/XlibConf.h]) commit 4a89b7ea908554628f374537a79931c8006a2de3 Author: Thomas Klausner <[email protected]> Date: Sun Jun 2 11:49:54 2013 -0700 cmsMath.c: Add missing stdio header for printf(3) in DEBUG build. Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/src/xcms/cmsMath.c b/src/xcms/cmsMath.c index 70b0675..487eb3f 100644 --- a/src/xcms/cmsMath.c +++ b/src/xcms/cmsMath.c @@ -35,6 +35,10 @@ in this Software without prior written authorization from The Open Group. #include "Xlibint.h" #include "Xcmsint.h" +#ifdef DEBUG +#include <stdio.h> +#endif + #include <float.h> #ifndef DBL_EPSILON #define DBL_EPSILON 1e-6 commit 96dcf747f13b26b8e4d17b1bc8605d933c3e1dc6 Author: Thomas Klausner <[email protected]> Date: Sun Jun 2 20:49:48 2013 +0200 XCreateGC man page: Avoid .TS H and .TH macros Avoid .TS H and .TH for now as it doesn't alter the output in this case, and improve the output with mandoc(1). Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/man/XCreateGC.man b/man/XCreateGC.man index 62a2f00..de0d039 100644 --- a/man/XCreateGC.man +++ b/man/XCreateGC.man @@ -460,7 +460,7 @@ are: .\" and operation. .\".CP T 1 .\"Display Functions -.TS H +.TS lw(1.5i) cw(.5i) lw(2i). _ .sp 6p @@ -469,7 +469,6 @@ Function Name Value Operation .sp 6p _ .sp 6p -.TH T{ .ZN GXclear T} T{ commit 95a388158c9d73df7d24016d6a3d61506d7d53a4 Author: Alan Coopersmith <[email protected]> Date: Thu May 23 19:43:35 2013 -0700 libX11 1.5.99.902 (1.6 RC2) Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/configure.ac b/configure.ac index 7734219..1f24bd2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([libX11], [1.5.99.901], +AC_INIT([libX11], [1.5.99.902], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libX11]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([src/config.h include/X11/XlibConf.h]) commit a3bdd2b090915fe0163b062f0e6576fe05dd332e Author: Julien Cristau <[email protected]> Date: Thu May 23 20:39:46 2013 +0200 xkb: fix off-by-one in _XkbReadGetNamesReply and _XkbReadVirtualModMap The size of the arrays is max_key_code + 1. This makes these functions consistent with the other checks added for CVE-2013-1997. Also check the XkbGetNames reply when names->keys was just allocated. Signed-off-by: Julien Cristau <[email protected]> Tested-by: Colin Walters <[email protected]> Reviewed-by: Alan Coopersmith <[email protected]> diff --git a/src/xkb/XKBGetMap.c b/src/xkb/XKBGetMap.c index 0875dfd..c73e655 100644 --- a/src/xkb/XKBGetMap.c +++ b/src/xkb/XKBGetMap.c @@ -426,7 +426,7 @@ XkbServerMapPtr srv; if ( rep->totalVModMapKeys>0 ) { if (((int) rep->firstVModMapKey + rep->nVModMapKeys) - > xkb->max_key_code) + > xkb->max_key_code + 1) return BadLength; if (((xkb->server==NULL)||(xkb->server->vmodmap==NULL))&& (XkbAllocServerMap(xkb,XkbVirtualModMapMask,0)!=Success)) { diff --git a/src/xkb/XKBNames.c b/src/xkb/XKBNames.c index 0f1e48e..3a8860b 100644 --- a/src/xkb/XKBNames.c +++ b/src/xkb/XKBNames.c @@ -180,7 +180,7 @@ _XkbReadGetNamesReply( Display * dpy, nKeys= xkb->max_key_code+1; names->keys= _XkbTypedCalloc(nKeys,XkbKeyNameRec); } - else if ( ((int)rep->firstKey + rep->nKeys) > xkb->max_key_code) + if ( ((int)rep->firstKey + rep->nKeys) > xkb->max_key_code + 1) goto BAILOUT; if (names->keys!=NULL) { if (!_XkbCopyFromReadBuffer(&buf, commit 7e30056e78e4b7979ff47f102e00327617266019 Author: Niveditha Rau <[email protected]> Date: Fri May 17 15:26:21 2013 -0700 Make sure internal headers include required headers Fixes builds with Solaris Studio 12.3 when lint is enabled, since it no longer ignores *.h files, but complains when they reference undefined typedefs or macros. Signed-off-by: Niveditha Rau <[email protected]> Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/src/Cmap.h b/src/Cmap.h index 062b538..78cc3ea 100644 --- a/src/Cmap.h +++ b/src/Cmap.h @@ -2,6 +2,8 @@ #ifndef _CMAP_H_ #define _CMAP_H_ +#include <X11/Xlib.h> + extern void _XcmsDeleteCmapRec( Display *dpy, diff --git a/src/Cr.h b/src/Cr.h index 800c9ab..635e9e4 100644 --- a/src/Cr.h +++ b/src/Cr.h @@ -2,6 +2,8 @@ #ifndef _CR_H_ #define _CR_H_ +#include <X11/Xlib.h> + extern int _XUpdateGCCache( register GC gc, register unsigned long mask, diff --git a/src/Key.h b/src/Key.h index 0fe89ba..bb25439 100644 --- a/src/Key.h +++ b/src/Key.h @@ -2,6 +2,9 @@ #ifndef _KEY_H_ #define _KEY_H_ +#include <X11/Xlib.h> +#include <X11/Xresource.h> + #ifndef NEEDKTABLE extern const unsigned char _XkeyTable[]; #endif diff --git a/src/Xintatom.h b/src/Xintatom.h index 82dba36..516a72b 100644 --- a/src/Xintatom.h +++ b/src/Xintatom.h @@ -2,6 +2,7 @@ #ifndef _XINTATOM_H_ #define _XINTATOM_H_ 1 +#include <X11/Xlib.h> #include <X11/Xfuncproto.h> /* IntAtom.c */ diff --git a/src/Xintconn.h b/src/Xintconn.h index db59061..cd9aee3 100644 --- a/src/Xintconn.h +++ b/src/Xintconn.h @@ -3,6 +3,7 @@ #define _XINTCONN_H_ 1 #include <X11/Xfuncproto.h> +#include <X11/Xlib.h> _XFUNCPROTOBEGIN diff --git a/src/Xprivate.h b/src/Xprivate.h index 006b170..6bfe70b 100644 --- a/src/Xprivate.h +++ b/src/Xprivate.h @@ -8,6 +8,8 @@ #ifndef XPRIVATE_H #define XPRIVATE_H +#include <X11/Xlib.h> + extern _X_HIDDEN void _XIDHandler(Display *dpy); extern _X_HIDDEN void _XSeqSyncFunction(Display *dpy); extern _X_HIDDEN void _XSetPrivSyncFunction(Display *dpy); diff --git a/src/Xresinternal.h b/src/Xresinternal.h index c2f355f..b5cc7ff 100644 --- a/src/Xresinternal.h +++ b/src/Xresinternal.h @@ -2,6 +2,8 @@ #ifndef _XRESINTERNAL_H_ #define _XRESINTERNAL_H_ +#include <X11/Xlib.h> +#include <X11/Xresource.h> #include <inttypes.h> /* type defines */ diff --git a/src/locking.h b/src/locking.h index 96019fc..5251a60 100644 --- a/src/locking.h +++ b/src/locking.h @@ -36,6 +36,8 @@ in this Software without prior written authorization from The Open Group. #define xmalloc(s) Xmalloc(s) #define xfree(s) Xfree(s) +#include <X11/Xlib.h> +#include <X11/Xlibint.h> #include <X11/Xthreads.h> struct _XCVList { commit 2820100bf8ba130b94253f415e7fa5ac28bb2037 Author: Alan Coopersmith <[email protected]> Date: Thu May 16 23:05:36 2013 -0700 Free fs->properties in _XF86BigfontQueryFont overflow error path Fixes small memory leak introduced in commit 5669a22081 Reported-by: Julien Cristau <[email protected]> Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/src/Font.c b/src/Font.c index 3beb8a5..a32f740 100644 --- a/src/Font.c +++ b/src/Font.c @@ -507,6 +507,7 @@ _XF86BigfontQueryFont ( any real font needs, so the combined total doesn't overflow either */ if (reply.nUniqCharInfos > ((ULONG_MAX / 2) / SIZEOF(xCharInfo)) || reply.nCharInfos > ((ULONG_MAX / 2) / sizeof(CARD16))) { + Xfree((char *) fs->properties); Xfree((char *) fs); _XEatDataWords(dpy, reply_left); return (XFontStruct *)NULL; commit 3131740513133a9ff7cb12123d29ceb18584fc38 Author: Matthieu Herrb <[email protected]> Date: Wed May 8 19:33:09 2013 +0200 XListFontsWithInfo: Re-decrement flist[0] before calling free() on it. Freeing a pointer that wasn't returned by malloc() is undefined behavior and produces an error with OpenBSD's implementation. Signed-off-by: Matthieu Herrb <[email protected]> Reviewed-by: Alan Coopersmith <[email protected]> Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/src/FontInfo.c b/src/FontInfo.c index 4b295a5..0cb5b19 100644 --- a/src/FontInfo.c +++ b/src/FontInfo.c @@ -174,8 +174,10 @@ XFontStruct **info) /* RETURN */ badmem: /* Free all memory allocated by this function. */ for (j=(i-1); (j >= 0); j--) { - Xfree(flist[j]); - if (finfo[j].properties) Xfree((char *) finfo[j].properties); + if (j == 0) + flist[j]--; /* was incremented above */ + Xfree(flist[j]); + if (finfo[j].properties) Xfree((char *) finfo[j].properties); } if (flist) Xfree((char *) flist); if (finfo) Xfree((char *) finfo); commit 3fe4bea086149f06a142a8f1d575f627ec1e22c7 Author: Alan Coopersmith <[email protected]> Date: Fri Apr 19 14:30:40 2013 -0700 Give GNU & Solaris Studio compilers hints about XEatData branches Try to offset the cost of all the recent checks we've added by giving the compiler a hint that the branches that involve us eating data are less likely to be used than the ones that process it. Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h index d63a534..acbad6b 100644 --- a/include/X11/Xlibint.h +++ b/include/X11/Xlibint.h @@ -832,6 +832,15 @@ typedef struct _XExten { /* private to extension mechanism */ struct _XExten *next_flush; /* next in list of those with flushes */ } _XExtension; +/* Temporary definition until we can depend on an xproto release with it */ +#ifdef _X_COLD +# define _XLIB_COLD _X_COLD +#elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403) /* 4.3+ */ +# define _XLIB_COLD __attribute__((__cold__)) +#else +# define _XLIB_COLD /* nothing */ +#endif + /* extension hooks */ #ifdef DataRoutineIsProcedure @@ -854,11 +863,14 @@ extern int (*_XErrorFunction)( extern void _XEatData( Display* /* dpy */, unsigned long /* n */ -); +) _XLIB_COLD; extern void _XEatDataWords( Display* /* dpy */, unsigned long /* n */ -); +) _XLIB_COLD; +#if defined(__SUNPRO_C) /* Studio compiler alternative to "cold" attribute */ +# pragma rarely_called(_XEatData, _XEatDataWords) +#endif extern char *_XAllocScratch( Display* /* dpy */, unsigned long /* nbytes */ commit e1b457beb8d4e831ef44279dada6c475cb955738 Author: Alan Coopersmith <[email protected]> Date: Sun Mar 31 12:22:35 2013 -0700 _XkbReadGetMapReply: reject maxKeyCodes smaller than the minKeyCode Various other bounds checks in the code assume this is true, so enforce it when we first get the data from the X server. Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/src/xkb/XKBGetMap.c b/src/xkb/XKBGetMap.c index 5551298..0875dfd 100644 --- a/src/xkb/XKBGetMap.c +++ b/src/xkb/XKBGetMap.c @@ -484,6 +484,8 @@ unsigned mask; if ( xkb->device_spec == XkbUseCoreKbd ) xkb->device_spec= rep->deviceID; + if ( rep->maxKeyCode < rep->minKeyCode ) + return BadImplementation; xkb->min_key_code = rep->minKeyCode; xkb->max_key_code = rep->maxKeyCode; commit 12ad4c6432496897ff000eb7cfecd0fb4b290331 Author: Alan Coopersmith <[email protected]> Date: Sat Mar 16 10:03:13 2013 -0700 Use calloc in XOpenDisplay to initialize structs containing pointers Prevents trying to free uninitialized pointers if we have to bail out partway through setup, such as if we receive a corrupted or incomplete connection setup block from the server. Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/src/OpenDis.c b/src/OpenDis.c index 7318ad9..fc67d1a 100644 --- a/src/OpenDis.c +++ b/src/OpenDis.c @@ -340,7 +340,7 @@ XOpenDisplay ( /* * Now iterate down setup information..... */ - dpy->pixmap_format = Xmalloc(dpy->nformats * sizeof(ScreenFormat)); + dpy->pixmap_format = Xcalloc(dpy->nformats, sizeof(ScreenFormat)); if (dpy->pixmap_format == NULL) { OutOfMemory (dpy); return(NULL); @@ -368,7 +368,7 @@ XOpenDisplay ( /* * next the Screen structures. */ - dpy->screens = Xmalloc(dpy->nscreens * sizeof(Screen)); + dpy->screens = Xcalloc(dpy->nscreens, sizeof(Screen)); if (dpy->screens == NULL) { OutOfMemory (dpy); return(NULL); @@ -410,7 +410,7 @@ XOpenDisplay ( /* * lets set up the depth structures. */ - sp->depths = Xmalloc(sp->ndepths * sizeof(Depth)); + sp->depths = Xcalloc(sp->ndepths, sizeof(Depth)); if (sp->depths == NULL) { OutOfMemory (dpy); return(NULL); @@ -432,7 +432,7 @@ XOpenDisplay ( dp->nvisuals = u.dp->nVisuals; u.dp = (xDepth *) (((char *) u.dp) + sz_xDepth); if (dp->nvisuals > 0) { - dp->visuals = Xmalloc(dp->nvisuals * sizeof(Visual)); + dp->visuals = Xcalloc(dp->nvisuals, sizeof(Visual)); if (dp->visuals == NULL) { OutOfMemory (dpy); return(NULL); commit d38527e25f8b6e2f1174ecc21260c5c5416f972e Author: Alan Coopersmith <[email protected]> Date: Thu Mar 7 23:46:05 2013 -0800 Remove more unnecessary casts from Xmalloc/calloc calls Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/src/Context.c b/src/Context.c index 79ae7d6..4bb465b 100644 --- a/src/Context.c +++ b/src/Context.c @@ -111,7 +111,7 @@ static void ResizeTable(DB db) otable = db->table; for (i = INITHASHMASK+1; (i + i) < db->numentries; ) i += i; - db->table = (TableEntry *) Xcalloc((unsigned)i, sizeof(TableEntry)); + db->table = Xcalloc(i, sizeof(TableEntry)); if (!db->table) { db->table = otable; return; @@ -180,11 +180,11 @@ int XSaveContext( UnlockDisplay(display); } if (!db) { - db = (DB) Xmalloc(sizeof(DBRec)); + db = Xmalloc(sizeof(DBRec)); if (!db) return XCNOMEM; db->mask = INITHASHMASK; - db->table = (TableEntry *)Xcalloc(db->mask + 1, sizeof(TableEntry)); + db->table = Xcalloc(db->mask + 1, sizeof(TableEntry)); if (!db->table) { Xfree((char *)db); return XCNOMEM; @@ -210,7 +210,7 @@ int XSaveContext( return 0; } } - entry = (TableEntry) Xmalloc(sizeof(TableEntryRec)); + entry = Xmalloc(sizeof(TableEntryRec)); if (!entry) return XCNOMEM; entry->rid = rid; diff --git a/src/CrGC.c b/src/CrGC.c index 11de94c..2d5f17c 100644 --- a/src/CrGC.c +++ b/src/CrGC.c @@ -72,7 +72,7 @@ GC XCreateGC ( register _XExtension *ext; LockDisplay(dpy); - if ((gc = (GC)Xmalloc (sizeof(struct _XGC))) == NULL) { + if ((gc = Xmalloc (sizeof(struct _XGC))) == NULL) { UnlockDisplay(dpy); SyncHandle(); return (NULL); diff --git a/src/Depths.c b/src/Depths.c index f49655c..a8b719d 100644 --- a/src/Depths.c +++ b/src/Depths.c @@ -49,7 +49,7 @@ int *XListDepths ( register Depth *dp; register int i; - depths = (int *) Xmalloc (count * sizeof(int)); + depths = Xmalloc (count * sizeof(int)); if (!depths) return NULL; for (i = 0, dp = scr->depths; i < count; i++, dp++) depths[i] = dp->depth; diff --git a/src/FSWrap.c b/src/FSWrap.c index 910e602..12d0406 100644 --- a/src/FSWrap.c +++ b/src/FSWrap.c @@ -112,7 +112,7 @@ _XParseBaseFontNameList( if (!*ptr) break; } - if (!(list = (char **) Xmalloc((unsigned)sizeof(char *) * (*num + 1)))) { + if (!(list = Xmalloc(sizeof(char *) * (*num + 1)))) { Xfree(psave); return (char **)NULL; } @@ -133,7 +133,7 @@ copy_string_list( if (string_list == NULL || list_count <= 0) return (char **) NULL; - string_list_ret = (char **) Xmalloc(sizeof(char *) * list_count); + string_list_ret = Xmalloc(sizeof(char *) * list_count); if (string_list_ret == NULL) return (char **) NULL; @@ -142,7 +142,7 @@ copy_string_list( for (length = 0; count-- > 0; list_src++) length += strlen(*list_src) + 1; - dst = (char *) Xmalloc(length); + dst = Xmalloc(length); if (dst == NULL) { Xfree(string_list_ret); return (char **) NULL; diff --git a/src/Font.c b/src/Font.c index 5dbdb29..3beb8a5 100644 --- a/src/Font.c +++ b/src/Font.c @@ -215,7 +215,7 @@ _XQueryFont ( DeqAsyncHandler(dpy, &async); reply_left = reply.length - ((SIZEOF(xQueryFontReply) - SIZEOF(xReply)) >> 2); - if (! (fs = (XFontStruct *) Xmalloc (sizeof (XFontStruct)))) { + if (! (fs = Xmalloc (sizeof (XFontStruct)))) { _XEatDataWords(dpy, reply_left); return (XFontStruct *)NULL; } @@ -323,7 +323,7 @@ _XF86BigfontCodes ( if (pData) return (XF86BigfontCodes *) pData->private_data; - pData = (XExtData *) Xmalloc(sizeof(XExtData) + sizeof(XF86BigfontCodes)); + pData = Xmalloc(sizeof(XExtData) + sizeof(XF86BigfontCodes)); if (!pData) { /* Out of luck. */ return (XF86BigfontCodes *) NULL; @@ -459,7 +459,7 @@ _XF86BigfontQueryFont ( DeqAsyncHandler(dpy, &async1); reply_left = reply.length - ((SIZEOF(xXF86BigfontQueryFontReply) - SIZEOF(xReply)) >> 2); - if (! (fs = (XFontStruct *) Xmalloc (sizeof (XFontStruct)))) { + if (! (fs = Xmalloc (sizeof (XFontStruct)))) { _XEatDataWords(dpy, reply_left); return (XFontStruct *)NULL; } @@ -521,14 +521,14 @@ _XF86BigfontQueryFont ( nbytes = reply.nUniqCharInfos * SIZEOF(xCharInfo) + (reply.nCharInfos+1)/2 * 2 * sizeof(CARD16); - pUniqCI = (xCharInfo *) Xmalloc (nbytes); + pUniqCI = Xmalloc (nbytes); if (!pUniqCI) { if (fs->properties) Xfree((char *) fs->properties); Xfree((char *) fs); _XEatDataWords(dpy, reply_left); return (XFontStruct *)NULL; } - if (! (fs->per_char = (XCharStruct *) Xmalloc (reply.nCharInfos * sizeof(XCharStruct)))) { + if (! (fs->per_char = Xmalloc (reply.nCharInfos * sizeof(XCharStruct)))) { Xfree((char *) pUniqCI); if (fs->properties) Xfree((char *) fs->properties); Xfree((char *) fs); @@ -555,7 +555,7 @@ _XF86BigfontQueryFont ( XEDataObject fs_union; char *addr; - pData = (XExtData *) Xmalloc(sizeof(XExtData)); + pData = Xmalloc(sizeof(XExtData)); if (!pData) { if (fs->properties) Xfree((char *) fs->properties); Xfree((char *) fs); diff --git a/src/GetAtomNm.c b/src/GetAtomNm.c index 996f7eb..32de50d 100644 --- a/src/GetAtomNm.c +++ b/src/GetAtomNm.c @@ -46,7 +46,7 @@ char *_XGetAtomName( for (idx = TABLESIZE; --idx >= 0; ) { if ((e = *table++) && (e->atom == atom)) { idx = strlen(EntryName(e)) + 1; - if ((name = (char *)Xmalloc(idx))) + if ((name = Xmalloc(idx))) strcpy(name, EntryName(e)); return name; } @@ -73,7 +73,7 @@ char *XGetAtomName( SyncHandle(); return(NULL); } - if ((name = (char *) Xmalloc(rep.nameLength+1))) { + if ((name = Xmalloc(rep.nameLength + 1))) { _XReadPad(dpy, name, (long)rep.nameLength); name[rep.nameLength] = '\0'; _XUpdateAtomCache(dpy, name, atom, 0, -1, 0); @@ -124,7 +124,7 @@ Bool _XGetAtomNameHandler( _XGetAsyncReply(dpy, (char *)&replbuf, rep, buf, len, (SIZEOF(xGetAtomNameReply) - SIZEOF(xReply)) >> 2, False); - state->names[state->idx] = (char *) Xmalloc(repl->nameLength+1); + state->names[state->idx] = Xmalloc(repl->nameLength + 1); _XGetAsyncData(dpy, state->names[state->idx], buf, len, SIZEOF(xGetAtomNameReply), repl->nameLength, repl->length << 2); @@ -170,7 +170,7 @@ XGetAtomNames ( } if (missed >= 0) { if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - if ((names_return[missed] = (char *) Xmalloc(rep.nameLength+1))) { + if ((names_return[missed] = Xmalloc(rep.nameLength + 1))) { _XReadPad(dpy, names_return[missed], (long)rep.nameLength); names_return[missed][rep.nameLength] = '\0'; _XUpdateAtomCache(dpy, names_return[missed], atoms[missed], diff --git a/src/GetHints.c b/src/GetHints.c index 4800fe7..3c410d3 100644 --- a/src/GetHints.c +++ b/src/GetHints.c @@ -128,7 +128,7 @@ XWMHints *XGetWMHints ( return(NULL); } /* static copies not allowed in library, due to reentrancy constraint*/ - if ((hints = (XWMHints *) Xcalloc (1, (unsigned) sizeof(XWMHints)))) { + if ((hints = Xcalloc (1, sizeof(XWMHints)))) { hints->flags = prop->flags; -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected] Archive: http://lists.debian.org/[email protected]

