- tzip checks if the mountpath is on TZ_SYS_HOME or TZ_SYS_RW_APP.
Thus the length of the comparation needs to be from TZ_SYS_HOME
or TZ_SYS_RW_APP, not the mountpath.
Change-Id: I8ace95651d6101ad1cf7ab85526ee03a4ebb966b
Signed-off-by: taeyoung <ty317.kim@samsung.com>
static int check_path_available(char *mountpath)
{
- size_t len;
+ const char *path;
if (!mountpath)
return 0;
- len = strlen(mountpath);
-
- if (!strncmp(mountpath, tzplatform_getenv(TZ_SYS_HOME), len))
+ path = tzplatform_getenv(TZ_SYS_HOME);
+ if (!strncmp(mountpath, path, strlen(path)))
return 1;
- if (!strncmp(mountpath, tzplatform_getenv(TZ_SYS_RW_APP), len))
+ path = tzplatform_getenv(TZ_SYS_RW_APP);
+ if (!strncmp(mountpath, path, strlen(path)))
return 1;
return 0;