From b06a91e92bd1e4f0bb5109206cee27f42f965b88 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Fri, 16 Dec 2022 21:40:36 +0900 Subject: [PATCH] Wayland: Fix wrong array size for _GLFWofferWayland Closes #2225 (cherry picked from commit 41d8da1cea55732867b5c3a7159215071b87b790) --- src/wl_window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wl_window.c b/src/wl_window.c index b1f47804..6330bdba 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1678,7 +1678,8 @@ static void dataDeviceHandleDataOffer(void* userData, struct wl_data_offer* offer) { _GLFWofferWayland* offers = - realloc(_glfw.wl.offers, _glfw.wl.offerCount + 1); + realloc(_glfw.wl.offers, + sizeof(_GLFWofferWayland) * (_glfw.wl.offerCount + 1)); if (!offers) { _glfwInputError(GLFW_OUT_OF_MEMORY, NULL);