From: Seung-Woo Kim Date: Thu, 10 Oct 2024 01:47:28 +0000 (+0900) Subject: Fix ASAN build issue X-Git-Tag: accepted/tizen/unified/20241011.010703^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb0487d0ffdd970d4edf8d4b52e8b55ed48ea597;p=platform%2Fcore%2Fuifw%2Fmmi-framework.git Fix ASAN build issue The strncpy with character size of fixed size string still causes stringop-truncation warning in ASAN build, so resolve the issue with strncpy of full size including terminated character. Change-Id: I09be11b837c3c1ed7f34e48b242bad912cbb92ca Signed-off-by: Seung-Woo Kim --- diff --git a/src/mmi/mmi-port.cpp b/src/mmi/mmi-port.cpp index f2bdda9..e7bc1ad 100644 --- a/src/mmi/mmi-port.cpp +++ b/src/mmi/mmi-port.cpp @@ -247,8 +247,7 @@ MMI_API int mmi_port_clone(mmi_port_h port, mmi_port_h *cloned) { return MMI_ERROR_OUT_OF_MEMORY; } - strncpy((*cloned)->name, port_s->name, MMI_NAME_MAX_LENGTH - 1); - (*cloned)->name[MMI_NAME_MAX_LENGTH - 1] = '\0'; + strncpy((*cloned)->name, port_s->name, MMI_NAME_MAX_LENGTH); (*cloned)->type = port_s->type; (*cloned)->data_type = port_s->data_type; (*cloned)->callbacks = port_s->callbacks;