Skip to content

Commit

Permalink
GUACAMOLE-1971: Merge safely multiply values to be used for memory al…
Browse files Browse the repository at this point in the history
…location.
  • Loading branch information
necouchman authored Jul 22, 2024
2 parents c715f16 + 9860229 commit 8651022
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/protocols/rdp/pointer.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,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) {
Expand All @@ -41,7 +42,8 @@ BOOL guac_rdp_pointer_new(rdpContext* context, rdpPointer* pointer) {
rdp_client->display, pointer->width, pointer->height);

/* Allocate data for image */
unsigned char* data = _aligned_malloc(pointer->width * pointer->height * 4, 16);
unsigned char* data = _aligned_malloc(guac_mem_ckd_mul_or_die(pointer->width,
pointer->height, 4), 16);

cairo_surface_t* surface;

Expand Down Expand Up @@ -122,4 +124,3 @@ BOOL guac_rdp_pointer_set_default(rdpContext* context) {

return TRUE;
}

0 comments on commit 8651022

Please sign in to comment.