kdbus: Replace strcpy() with strncpy() 86/269586/6
authorŁukasz Stelmach <l.stelmach@samsung.com>
Tue, 18 Jan 2022 19:45:12 +0000 (20:45 +0100)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Fri, 21 Jan 2022 13:12:05 +0000 (14:12 +0100)
Change-Id: Ie59bae03c5573e6a640998a6ae39f0753a98be95
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
tests/kdbus/kdbus-util.c

index 49aa4b7..5b29f85 100644 (file)
@@ -1480,7 +1480,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;
-       strcpy(item->str, name);
+       strncpy(item->str, name, strlen(name) + 1);
        item = KDBUS_ITEM_NEXT(item);
 
        for (i = 0; i < num_access; i++) {