From: Michal Bloch Date: Wed, 26 Jan 2022 16:01:55 +0000 (+0100) Subject: Use memcpy for unknown destination buffer size X-Git-Tag: submit/tizen_6.5/20220314.044848~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5873408a2ff53f958511e602f155abfff32b1586;p=platform%2Fkernel%2Flinux-tizen-modules-source.git Use memcpy for unknown destination buffer size Since we're using the source length instead of destination size, use memcpy instead. This is because the compiler realizes that this should've been implemented via strcpy (without N) and issues a warning, but then Tizen tools for static analysis complain about regular strcpy. Change-Id: I51b0b1e52bc221a972ac8863d3f82ac15f199dac Signed-off-by: Michal Bloch (cherry picked from commit 970cd407e2736c4c59774dd657a1a065f2978027) --- diff --git a/tests/kdbus/kdbus-util.c b/tests/kdbus/kdbus-util.c index 812e986..d9fa167 100644 --- a/tests/kdbus/kdbus-util.c +++ b/tests/kdbus/kdbus-util.c @@ -1477,7 +1477,7 @@ wur int kdbus_conn_update_policy(struct kdbus_conn *conn, const char *name, item->type = KDBUS_ITEM_NAME; item->size = KDBUS_ITEM_HEADER_SIZE + strlen(name) + 1; - strncpy(item->str, name, strlen(name) + 1); + memcpy(item->str, name, strlen(name) + 1); item = KDBUS_ITEM_NEXT(item); for (i = 0; i < num_access; i++) {