2021-10-30 04:25:12 +08:00
|
|
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
#include "Luau/Common.h"
|
|
|
|
|
2023-04-01 02:42:49 +08:00
|
|
|
#include <stddef.h>
|
2021-10-30 04:25:12 +08:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace Luau
|
|
|
|
{
|
|
|
|
void fuzzFormatString(const char* data, size_t size);
|
|
|
|
} // namespace Luau
|
|
|
|
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size)
|
|
|
|
{
|
|
|
|
// copy data to heap to make sure ASAN can catch out of bounds access
|
|
|
|
std::vector<char> str(Data, Data + Size);
|
|
|
|
|
|
|
|
Luau::fuzzFormatString(str.data(), str.size());
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|