未验证 提交 4bcac01a 编写于 作者: O openharmony_ci 提交者: Gitee

!2141 code secure check

Merge pull request !2141 from wxt/master
......@@ -35,13 +35,13 @@ static int DoRebootByInitPlugin(const char *mode, const char *option)
char value[MAX_REBOOT_OPTION_SIZE];
int ret = 0;
if (mode != NULL) {
if ((option != NULL) && (strlen(option) >= 0)) {
if (option != NULL) {
ret = snprintf_s(value, MAX_REBOOT_OPTION_SIZE, MAX_REBOOT_OPTION_SIZE - 1, "reboot,%s:%s", mode, option);
} else {
ret = snprintf_s(value, MAX_REBOOT_OPTION_SIZE, MAX_REBOOT_OPTION_SIZE - 1, "reboot,%s", mode);
}
} else {
if ((option != NULL) && (strlen(option) >= 0)) {
if (option != NULL) {
ret = snprintf_s(value, MAX_REBOOT_OPTION_SIZE, MAX_REBOOT_OPTION_SIZE - 1, "reboot,%s", option);
} else {
ret = snprintf_s(value, MAX_REBOOT_OPTION_SIZE, MAX_REBOOT_OPTION_SIZE - 1, "%s", "reboot");
......
......@@ -84,6 +84,9 @@ struct LocalParameterTestState {
valid = true;
}
LocalParameterTestState(const LocalParameterTestState&) = delete;
LocalParameterTestState & operator=(const LocalParameterTestState&) = delete;
~LocalParameterTestState() noexcept
{
for (int i = 0; i < nprops; i++) {
......
......@@ -24,9 +24,6 @@ namespace OHOS {
{
bool result = false;
std::unique_ptr<WatcherManager> watcherManager = std::make_unique<WatcherManager>(0, true);
if (watcherManager == nullptr) {
return result;
}
uint32_t id = static_cast<const uint32_t>(*data);
if (!watcherManager->AddRemoteWatcher(id, nullptr)) {
result = true;
......
......@@ -24,9 +24,6 @@ namespace OHOS {
{
bool result = false;
std::unique_ptr<WatcherManager> watcherManager = std::make_unique<WatcherManager>(0, true);
if (watcherManager == nullptr) {
return result;
}
std::string str(reinterpret_cast<const char*>(data), size);
if (!watcherManager->AddWatcher(str, 0)) {
......
......@@ -24,9 +24,6 @@ namespace OHOS {
{
bool result = false;
std::unique_ptr<WatcherManager> watcherManager = std::make_unique<WatcherManager>(0, true);
if (watcherManager == nullptr) {
return result;
}
uint32_t id = static_cast<const uint32_t>(*data);
if (!watcherManager->DelRemoteWatcher(id)) {
......
......@@ -24,9 +24,6 @@ namespace OHOS {
{
bool result = false;
std::unique_ptr<WatcherManager> watcherManager = std::make_unique<WatcherManager>(0, true);
if (watcherManager == nullptr) {
return result;
}
std::string str(reinterpret_cast<const char*>(data), size);
if (!watcherManager->DelWatcher(str, 0)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册