diff options
author | marha <marha@users.sourceforge.net> | 2013-07-23 09:22:39 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-07-23 09:22:39 +0200 |
commit | a7c19a157eb0ba6a7789fe31f5bf7a2066d7966c (patch) | |
tree | d00e9cb782f34582f722e3da544b9c42b16ac850 /xorg-server/hw/kdrive/ephyr/XF86dri.c | |
parent | 81d811ac780a2524fff09a516b6f0212c3f209a2 (diff) | |
parent | 5c340ceb9356ea029dea53b73440268d4769d5a5 (diff) | |
download | vcxsrv-a7c19a157eb0ba6a7789fe31f5bf7a2066d7966c.tar.gz vcxsrv-a7c19a157eb0ba6a7789fe31f5bf7a2066d7966c.tar.bz2 vcxsrv-a7c19a157eb0ba6a7789fe31f5bf7a2066d7966c.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
libX11 libXmu mesa xserver git update 23 July 2013
Diffstat (limited to 'xorg-server/hw/kdrive/ephyr/XF86dri.c')
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/XF86dri.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/XF86dri.c b/xorg-server/hw/kdrive/ephyr/XF86dri.c index 9d742f394..15b62191f 100644 --- a/xorg-server/hw/kdrive/ephyr/XF86dri.c +++ b/xorg-server/hw/kdrive/ephyr/XF86dri.c @@ -64,6 +64,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <GL/glx.h> #include "xf86dri.h" #include <X11/dri/xf86driproto.h> +#include <limits.h> static XExtensionInfo _xf86dri_info_data; static XExtensionInfo *xf86dri_info = &_xf86dri_info_data; @@ -225,8 +226,12 @@ XF86DRIOpenConnection(Display * dpy, int screen, } if (rep.length) { - if (!(*busIdString = (char *) calloc(rep.busIdStringLength + 1, 1))) { - _XEatData(dpy, ((rep.busIdStringLength + 3) & ~3)); + if (rep.busIdStringLength < INT_MAX) + *busIdString = calloc(rep.busIdStringLength + 1, 1); + else + *busIdString = NULL; + if (*busIdString == NULL) { + _XEatDataWords(dpy, rep.length); UnlockDisplay(dpy); SyncHandle(); TRACE("OpenConnection... return False"); @@ -323,10 +328,12 @@ XF86DRIGetClientDriverName(Display * dpy, int screen, *ddxDriverPatchVersion = rep.ddxDriverPatchVersion; if (rep.length) { - if (! - (*clientDriverName = - (char *) calloc(rep.clientDriverNameLength + 1, 1))) { - _XEatData(dpy, ((rep.clientDriverNameLength + 3) & ~3)); + if (rep.clientDriverNameLength < INT_MAX) + *clientDriverName = calloc(rep.clientDriverNameLength + 1, 1); + else + *clientDriverName = NULL; + if (*clientDriverName == NULL) { + _XEatDataWords(dpy, rep.length); UnlockDisplay(dpy); SyncHandle(); TRACE("GetClientDriverName... return False"); @@ -532,7 +539,7 @@ XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable, SIZEOF(xGenericReply) + total_rects * sizeof(drm_clip_rect_t)) + 3) & ~3) >> 2)) { - _XEatData(dpy, rep.length); + _XEatDataWords(dpy, rep.length); UnlockDisplay(dpy); SyncHandle(); TRACE("GetDrawableInfo... return False"); @@ -606,7 +613,7 @@ XF86DRIGetDeviceInfo(Display * dpy, int screen, drm_handle_t * hFrameBuffer, if (rep.length) { if (!(*pDevPrivate = (void *) calloc(rep.devPrivateSize, 1))) { - _XEatData(dpy, ((rep.devPrivateSize + 3) & ~3)); + _XEatDataWords(dpy, rep.length); UnlockDisplay(dpy); SyncHandle(); TRACE("GetDeviceInfo... return False"); |