Remove access to avoid toctou problem 52/258652/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 21 May 2021 10:05:47 +0000 (19:05 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Fri, 21 May 2021 10:05:47 +0000 (19:05 +0900)
Change-Id: I67a58159cc453ec7c60dd685663f7d03424af5d7
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
engine-parser/src/stt-engine-parser.c

index 260f59f..6ecbbfc 100644 (file)
@@ -300,11 +300,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);
-       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)