diff options
-rw-r--r-- | src/XEVI.c | 3 | ||||
-rw-r--r-- | src/XShape.c | 5 | ||||
-rw-r--r-- | src/Xdbe.c | 3 |
3 files changed, 7 insertions, 4 deletions
@@ -31,6 +31,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <X11/extensions/extutil.h> #include <X11/Xutil.h> #include <limits.h> +#include "reallocarray.h" static XExtensionInfo *xevi_info;/* needs to move to globals.c */ static const char *xevi_extension_name = EVINAME; @@ -146,7 +147,7 @@ Status XeviGetVisualInfo( return BadValue; } } - temp_visual = Xmalloc(sz_VisualID32 * n_visual); + temp_visual = Xmallocarray(n_visual, sz_VisualID32); for (visualIndex = 0; visualIndex < n_visual; visualIndex++) temp_visual[visualIndex] = visual[visualIndex]; } diff --git a/src/XShape.c b/src/XShape.c index 15d754f..c51e5b9 100644 --- a/src/XShape.c +++ b/src/XShape.c @@ -36,6 +36,7 @@ in this Software without prior written authorization from The Open Group. #include <X11/extensions/shape.h> #include <X11/extensions/shapeproto.h> #include <limits.h> +#include "reallocarray.h" static XExtensionInfo _shape_info_data; static XExtensionInfo *shape_info = &_shape_info_data; @@ -463,8 +464,8 @@ XRectangle *XShapeGetRectangles ( rects = NULL; if (rep.nrects) { if (rep.nrects < (INT_MAX / sizeof (XRectangle))) { - xrects = Xmalloc (rep.nrects * sizeof (xRectangle)); - rects = Xmalloc (rep.nrects * sizeof (XRectangle)); + xrects = Xmallocarray (rep.nrects, sizeof (xRectangle)); + rects = Xmallocarray (rep.nrects, sizeof (XRectangle)); } else { xrects = NULL; rects = NULL; @@ -40,6 +40,7 @@ #include <X11/extensions/Xdbe.h> #include <X11/extensions/dbeproto.h> #include <limits.h> +#include "reallocarray.h" static XExtensionInfo _dbe_info_data; static XExtensionInfo *dbe_info = &_dbe_info_data; @@ -367,7 +368,7 @@ XdbeScreenVisualInfo *XdbeGetVisualInfo ( if (c < 65536) { scrVisInfo[i].count = c; - scrVisInfo[i].visinfo = Xmalloc(c * sizeof(XdbeVisualInfo)); + scrVisInfo[i].visinfo = Xmallocarray(c, sizeof(XdbeVisualInfo)); } else scrVisInfo[i].visinfo = NULL; |