Skip to content

Instantly share code, notes, and snippets.

@schwehr
Created April 22, 2017 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schwehr/d4d48b60ed99986ce18703262fe98758 to your computer and use it in GitHub Desktop.
Save schwehr/d4d48b60ed99986ce18703262fe98758 to your computer and use it in GitHub Desktop.
class WithQuietHandler {
public:
WithQuietHandler() { CPLPushErrorHandler(CPLQuietErrorHandler); }
~WithQuietHandler() { CPLPopErrorHandler(); }
};
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
WithQuietHandler handler;
const char kFilename[] = "/vsimem/a.geojson";
const string data2(reinterpret_cast<const char *>(data), size);
autotest2::VsiMemTempWrapper wrapper(kFilename, data2);
auto open_info =
gtl::MakeUnique<GDALOpenInfo>(kFilename, GDAL_OF_READONLY, nullptr);
std::unique_ptr<OGRGeoJSONDataSource> dataset(new OGRGeoJSONDataSource);
const int result = dataset->Open(open_info.get(), eGeoJSONSourceFile);
CHECK(result == FALSE || result == TRUE);
// TODO(schwehr): Try to go through the rows.
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment