fuzz高风险DestroyVirtualScreen接口覆盖

Signed-off-by: 张有康 <zhangyoukang@h-partners.com>
This commit is contained in:
张有康 2024-06-13 21:07:53 +08:00
parent ba2b105832
commit 22b6a0c658

View File

@ -137,7 +137,7 @@ bool MakeMirrorWithVirtualScreenFuzzTest(const uint8_t *data, size_t size)
bool MakeExpandWithVirtualScreenFuzzTest(const uint8_t *data, size_t size)
{
if (data == nullptr || size < sizeof(VirtualScreenOption)) {
if (data == nullptr || size < DATA_MIN_SIZE) {
return false;
}
size_t startPos = 0;
@ -178,7 +178,7 @@ bool MakeExpandWithVirtualScreenFuzzTest(const uint8_t *data, size_t size)
bool CreateAndDestroyVirtualScreenFuzzTest(const uint8_t *data, size_t size)
{
if (data == nullptr || size < sizeof(VirtualScreenOption)) {
if (data == nullptr || size < DATA_MIN_SIZE) {
return false;
}
size_t startPos = 0;
@ -200,6 +200,7 @@ bool CreateAndDestroyVirtualScreenFuzzTest(const uint8_t *data, size_t size)
screenManager.UnregisterScreenGroupListener(screenGroupListener);
screenManager.UnregisterScreenListener(screenListener);
screenManager.GetScreenById(screenId);
screenManager.DestroyVirtualScreen(screenId);
return true;
}