From 25f9eca45b99b5c9f3eb27e0b863b0b124ff39a5 Mon Sep 17 00:00:00 2001 From: Seungyun Lee Date: Wed, 31 Aug 2022 00:33:37 +0900 Subject: [PATCH] fix: Change len value to make string not truncated --- PlayTools/PlayLoader.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PlayTools/PlayLoader.m b/PlayTools/PlayLoader.m index 1e1c6cce..ef2a15ba 100644 --- a/PlayTools/PlayLoader.m +++ b/PlayTools/PlayLoader.m @@ -90,6 +90,7 @@ static int my_sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void * int ret = sysctlbyname(name, oldp, oldlenp, newp, newlen); const char *mechine = DEVICE_MODEL; strncpy((char *)oldp, mechine, strlen(mechine)); + *oldlenp = strlen(mechine); return ret; } else { int ret = sysctlbyname(name, oldp, oldlenp, newp, newlen); @@ -100,6 +101,7 @@ static int my_sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void * int ret = sysctlbyname(name, oldp, oldlenp, newp, newlen); const char *mechine = OEM_ID; strncpy((char *)oldp, mechine, strlen(mechine)); + *oldlenp = strlen(mechine); return ret; } else { int ret = sysctlbyname(name, oldp, oldlenp, newp, newlen);