mirror of
https://github.com/openharmony/ace_napi.git
synced 2026-07-22 09:15:27 -04:00
@@ -195,7 +195,7 @@ bool NativeModuleManager::GetNativeModulePath(
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (sprintf_s(nativeModulePath[0], pathLength, "%s/lib%s",
|
||||
if (sprintf_s(nativeModulePath[0], pathLength, "%s/lib%s%s",
|
||||
prefix, dupModuleName, soPostfix) == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ ExceptionInfo* ArkNativeEngine::GetExceptionForWorker() const
|
||||
ExceptionInfo* exceptionInfo = new ExceptionInfo();
|
||||
int msgLength = exceptionStr_.length();
|
||||
char* exceptionMessage = new char[msgLength + 1] { 0 };
|
||||
if (memcpy_s(exceptionMessage, msgLength, exceptionStr_.c_str(), msgLength) != EOK) {
|
||||
if (memcpy_s(exceptionMessage, msgLength + 1, exceptionStr_.c_str(), msgLength) != EOK) {
|
||||
HILOG_ERROR("worker:: memcpy_s error");
|
||||
delete exceptionInfo;
|
||||
delete[] exceptionMessage;
|
||||
|
||||
+2
-2
@@ -62,8 +62,8 @@ static void PrintLog(const char* fmt, ...)
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
char buf[MAX_BUFFER_SIZE] = { "\0" };
|
||||
int ret = vsnprintf(buf, sizeof(buf) - 1, newFmt.c_str(), args);
|
||||
char buf[MAX_BUFFER_SIZE] = { '\0' };
|
||||
int ret = vsnprintf_s(buf, sizeof(buf), sizeof(buf) - 1, newFmt.c_str(), args);
|
||||
if (ret < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user