Prevent buffer overflow issue 46/299946/1
authorInhong Han <inhong1.han@samsung.com>
Thu, 12 Oct 2023 11:13:11 +0000 (20:13 +0900)
committerInhong Han <inhong1.han@samsung.com>
Thu, 12 Oct 2023 11:13:11 +0000 (20:13 +0900)
Change-Id: I00f5d5f5af4b4e80c68f40ce729f50adfb3ebd28

ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp

index 59dc1de..d04ed6e 100644 (file)
@@ -420,7 +420,7 @@ _wsc_im_ctx_input_panel_data (void *data, struct zwp_input_method_context_v1 *im
             free(wsc_ctx->impl->imdata);
         }
 
-        wsc_ctx->impl->imdata = calloc(1, input_panel_data_length);
+        wsc_ctx->impl->imdata = calloc(1, input_panel_data_length + 1);
         if (wsc_ctx->impl->imdata)
             memcpy(wsc_ctx->impl->imdata, input_panel_data, input_panel_data_length);