Remove access function to avoid toctou problem 18/258618/2
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 21 May 2021 06:22:50 +0000 (15:22 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Fri, 21 May 2021 07:24:43 +0000 (16:24 +0900)
Change-Id: I8291353ba9770a470a35cccaddc8a0d6cb8f20ea
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
engine-parser/src/tts-engine-parser.c

index a9e2789..05caa3a 100644 (file)
@@ -325,11 +325,9 @@ static int __remove_engine_info_xml(const char *pkgid, gchar *ut, uid_t uid)
 
        char path[256] = {'\0',};
        snprintf(path, 256, "%s/%s.xml", dir_engine_info, pkgid);
 
        char path[256] = {'\0',};
        snprintf(path, 256, "%s/%s.xml", dir_engine_info, pkgid);
-       if (0 == access(path, F_OK)) {
-               LOGD("Remove engine info xml(%s)", path);
-               if (0 != remove(path)) {
-                       LOGE("[ERROR] Fail to Remove engine info xml(%s)", path);
-               }
+       LOGD("Remove engine info xml(%s)", path);
+       if (0 != remove(path)) {
+               LOGE("[ERROR] Fail to Remove engine info xml(%s)", path);
        }
 
        FREE(dir_engine_info)
        }
 
        FREE(dir_engine_info)