From b57e96e34c6479ea434c40ccdded6083459673b4 Mon Sep 17 00:00:00 2001 From: wangdengjia Date: Mon, 19 Jul 2021 20:39:30 +0800 Subject: [PATCH] IssueNo:#I41FEV Description:add judge whether it is negative Sig:startup Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangdengjia --- services/bundlemgr_lite/src/extractor_util.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/bundlemgr_lite/src/extractor_util.cpp b/services/bundlemgr_lite/src/extractor_util.cpp index 935f9a6..9895713 100755 --- a/services/bundlemgr_lite/src/extractor_util.cpp +++ b/services/bundlemgr_lite/src/extractor_util.cpp @@ -68,6 +68,10 @@ bool ExtractorUtil::ExtractFileToPath(const std::string &filePath, const std::st fileStream.close(); int fd = open(filePath.c_str(), O_RDWR, S_IRUSR | S_IWUSR); + if (fd < 0) { + HILOG_ERROR(HILOG_MODULE_APP, "ExtractFileToPath open fail"); + return false; + } fsync(fd); close(fd); return true; -- Gitee