mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-19 17:08:11 -04:00
!912 Change memcpy to memcpy_s
Merge pull request !912 from xiaojianfeng/master
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "displaymanager_fuzzer.h"
|
||||
|
||||
#include <securec.h>
|
||||
#include "display_manager.h"
|
||||
|
||||
namespace OHOS ::Rosen {
|
||||
@@ -45,8 +46,7 @@ size_t GetObject(T &object, const uint8_t *data, size_t size)
|
||||
if (objectSize > size) {
|
||||
return 0;
|
||||
}
|
||||
std::memcpy(&object, data, objectSize);
|
||||
return objectSize;
|
||||
return memcpy_s(&object, objectSize, data, objectSize) == EOK ? objectSize : 0;
|
||||
}
|
||||
|
||||
bool DisplayFuzzTest(const uint8_t* data, size_t size)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <iremote_broker.h>
|
||||
#include <iservice_registry.h>
|
||||
#include <securec.h>
|
||||
#include <system_ability_definition.h>
|
||||
|
||||
#include "display_manager_interface.h"
|
||||
@@ -33,8 +34,7 @@ size_t GetObject(T &object, const uint8_t *data, size_t size)
|
||||
if (objectSize > size) {
|
||||
return 0;
|
||||
}
|
||||
std::memcpy(&object, data, objectSize);
|
||||
return objectSize;
|
||||
return memcpy_s(&object, objectSize, data, objectSize) == EOK ? objectSize : 0;
|
||||
}
|
||||
|
||||
std::pair<sptr<IDisplayManager>, sptr<IRemoteObject>> GetProxy()
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "screen_fuzzer.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <securec.h>
|
||||
|
||||
#include "display_manager.h"
|
||||
#include "display.h"
|
||||
@@ -31,8 +32,7 @@ size_t GetObject(T &object, const uint8_t *data, size_t size)
|
||||
if (objectSize > size) {
|
||||
return 0;
|
||||
}
|
||||
std::memcpy(&object, data, objectSize);
|
||||
return objectSize;
|
||||
return memcpy_s(&object, objectSize, data, objectSize) == EOK ? objectSize : 0;
|
||||
}
|
||||
|
||||
bool ScreenFuzzTest(const uint8_t *data, size_t size)
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "screenmanager_fuzzer.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <securec.h>
|
||||
|
||||
#include "dm_common.h"
|
||||
#include "screen.h"
|
||||
@@ -51,8 +52,7 @@ size_t GetObject(T &object, const uint8_t *data, size_t size)
|
||||
if (objectSize > size) {
|
||||
return 0;
|
||||
}
|
||||
std::memcpy(&object, data, objectSize);
|
||||
return objectSize;
|
||||
return memcpy_s(&object, objectSize, data, objectSize) == EOK ? objectSize : 0;
|
||||
}
|
||||
|
||||
bool ScreenPowerFuzzTest(const uint8_t *data, size_t size)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <iremote_broker.h>
|
||||
#include <iservice_registry.h>
|
||||
#include <securec.h>
|
||||
#include <system_ability_definition.h>
|
||||
|
||||
#include "zidl/window_manager_proxy.h"
|
||||
@@ -33,8 +34,7 @@ size_t GetObject(T &object, const uint8_t *data, size_t size)
|
||||
if (objectSize > size) {
|
||||
return 0;
|
||||
}
|
||||
std::memcpy(&object, data, objectSize);
|
||||
return objectSize;
|
||||
return memcpy_s(&object, objectSize, data, objectSize) == EOK ? objectSize : 0;
|
||||
}
|
||||
|
||||
std::pair<sptr<IWindowManager>, sptr<IRemoteObject>> GetProxy()
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "windowscene_fuzzer.h"
|
||||
|
||||
#include <securec.h>
|
||||
|
||||
#include "display_manager.h"
|
||||
#include "window.h"
|
||||
#include "window_manager.h"
|
||||
@@ -55,8 +59,7 @@ size_t GetObject(T &object, const uint8_t *data, size_t size)
|
||||
if (objectSize > size) {
|
||||
return 0;
|
||||
}
|
||||
std::memcpy(&object, data, objectSize);
|
||||
return objectSize;
|
||||
return memcpy_s(&object, objectSize, data, objectSize) == EOK ? objectSize : 0;
|
||||
}
|
||||
|
||||
size_t InitWindowOption1(WindowOption &windowOption, const uint8_t *data, size_t size)
|
||||
|
||||
Reference in New Issue
Block a user