Skip to content
This repository was archived by the owner on Mar 22, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions .code-intelligence/fuzz_targets/fuzz_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
#include <registry.h>

#include <test_util.h>
#include "file_input.h"

const char* write_to_file(const uint8_t *Data, size_t Size) {
const char* filename = "/tmp/fuzz_input";
FILE *fp;
fp = fopen(filename, "w+");
fwrite(Data, Size, 1, fp);
fclose(fp);
return filename;
}

static void test_parsing(parser_handle_t parser){
if (parser->show_info != NULL)
Expand Down Expand Up @@ -99,15 +106,13 @@ extern "C" int FUZZ_INIT() {
return 0;
}



extern "C" int FUZZ(const uint8_t *Data, size_t Size) {
auto file = ci::input_file(Data, Size);
auto file = write_to_file(Data, Size);

test_parser(file.name(), (const int8_t *)"aac");
test_parser(file.name(), (const int8_t *)"ac3");
test_parser(file.name(), (const int8_t *)"ec3");
test_parser(file.name(), (const int8_t *)"avc");
test_parser(file, (const int8_t *)"aac");
test_parser(file, (const int8_t *)"ac3");
test_parser(file, (const int8_t *)"ec3");
test_parser(file, (const int8_t *)"avc");

return 0;
}
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }}
fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }}
dashboard_address: ${{ env.WEB_APP_ADDRESS }}
timeout: 1800
timeout: 300
- id: save-results
name: Save Fuzz Test Results
uses: CodeIntelligenceTesting/github-actions/save-results@v3
Expand Down