GUACAMOLE-1971: Safely multiply values to be used for memory allocation.
diff --git a/src/protocols/rdp/pointer.c b/src/protocols/rdp/pointer.c
index 1d4a4e8..861e906 100644
--- a/src/protocols/rdp/pointer.c
+++ b/src/protocols/rdp/pointer.c
@@ -30,6 +30,7 @@
#include <freerdp/freerdp.h>
#include <freerdp/gdi/gdi.h>
#include <guacamole/client.h>
+#include <guacamole/mem.h>
#include <winpr/crt.h>
BOOL guac_rdp_pointer_new(rdpContext* context, rdpPointer* pointer) {
@@ -42,7 +43,8 @@
rdp_client->display, pointer->width, pointer->height);
/* Allocate data for image */
- unsigned char* data = GUAC_ALIGNED_MALLOC(pointer->width * pointer->height * 4, 16);
+ unsigned char* data = GUAC_ALIGNED_MALLOC(guac_mem_ckd_mul_or_die(pointer->width,
+ pointer->height, 4), 16);
cairo_surface_t* surface;