Fix string copy termination

Test: CTS regression
Bug: 78198288
Change-Id: Id433eb3197d4faf530d5f5090ff95e51689e7088
3 files changed