mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-07 08:03:29 +00:00
!7796 [Bug]: fix warning of security
Merge pull request !7796 from yangxiaoshuai2022/warning_fix_0614
This commit is contained in:
commit
dce94cf201
@ -13,6 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "ecmascript/compiler/aot_file/elf_checker.h"
|
||||
#include "ecmascript/platform/file.h"
|
||||
#include <fstream>
|
||||
#include <type_traits>
|
||||
|
||||
@ -88,6 +89,9 @@ ElfChecker::ElfChecker(const void* data, int len) : elfLen_(len), elfErrorCode_(
|
||||
|
||||
ElfChecker::ElfChecker(const std::string& path) : elfErrorCode_(0), fromMmap_(false)
|
||||
{
|
||||
if (!panda::ecmascript::FileExist(path.c_str())) {
|
||||
return;
|
||||
}
|
||||
std::ifstream file(path, std::ios::binary | std::ios::ate);
|
||||
if (file.is_open() == false) {
|
||||
elfData_ = nullptr;
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "constants.h"
|
||||
#include "file_path_utils.h"
|
||||
#include "securec.h"
|
||||
#include "ecmascript/platform/file.h"
|
||||
|
||||
namespace panda {
|
||||
namespace ecmascript {
|
||||
@ -110,6 +111,9 @@ bool Extractor::ExtractByName(const std::string &fileName, std::ostream &dest) c
|
||||
|
||||
bool Extractor::ExtractFile(const std::string &fileName, const std::string &targetPath) const
|
||||
{
|
||||
if (!panda::ecmascript::FileExist(targetPath.c_str())) {
|
||||
return false;
|
||||
}
|
||||
std::ofstream fileStream;
|
||||
fileStream.open(targetPath, std::ios_base::out | std::ios_base::binary);
|
||||
if (!fileStream.is_open()) {
|
||||
|
@ -114,7 +114,7 @@ EcmaRuntimeCallInfo* EcmaInterpreter::ReBuildRuntimeCallInfo(JSThread *thread, E
|
||||
*(--currentSp) = thisObj.GetRawData();
|
||||
*(--currentSp) = newTarget.GetRawData();
|
||||
*(--currentSp) = func.GetRawData();
|
||||
*(--currentSp) = numArgs + NUM_MANDATORY_JSFUNC_ARGS;
|
||||
*(--currentSp) = numArgs + static_cast<int>(NUM_MANDATORY_JSFUNC_ARGS);
|
||||
*(--currentSp) = ToUintPtr(thread);
|
||||
EcmaRuntimeCallInfo *ecmaRuntimeCallInfo = reinterpret_cast<EcmaRuntimeCallInfo *>(currentSp);
|
||||
|
||||
|
@ -148,4 +148,4 @@ class XScroll {
|
||||
|
||||
module.exports = {
|
||||
XScroll
|
||||
}
|
||||
};
|
@ -917,7 +917,7 @@ class IrViewer {
|
||||
}
|
||||
}
|
||||
}, this.findNext.bind(this));
|
||||
}
|
||||
};
|
||||
CanvasInput.SetSafeArea(...this.searchInput.pos);
|
||||
this.searchInput.Open();
|
||||
}
|
||||
|
@ -23,4 +23,4 @@ module.exports = {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
filename: 'main.js'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user